
bin/kernel:     file format elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:

.text
.globl kern_entry
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
c0100000:	b8 00 a0 11 00       	mov    $0x11a000,%eax
    movl %eax, %cr3
c0100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
c0100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
c010000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
c0100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
c0100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
c0100016:	8d 05 1e 00 10 c0    	lea    0xc010001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
c010001c:	ff e0                	jmp    *%eax

c010001e <next>:
next:

    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
c010001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
c0100020:	a3 00 a0 11 c0       	mov    %eax,0xc011a000

    # set ebp, esp
    movl $0x0, %ebp
c0100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
c010002a:	bc 00 90 11 c0       	mov    $0xc0119000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
c010002f:	e8 02 00 00 00       	call   c0100036 <kern_init>

c0100034 <spin>:

# should never get here
spin:
    jmp spin
c0100034:	eb fe                	jmp    c0100034 <spin>

c0100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
c0100036:	55                   	push   %ebp
c0100037:	89 e5                	mov    %esp,%ebp
c0100039:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
c010003c:	b8 8c cf 11 c0       	mov    $0xc011cf8c,%eax
c0100041:	2d 00 c0 11 c0       	sub    $0xc011c000,%eax
c0100046:	89 44 24 08          	mov    %eax,0x8(%esp)
c010004a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100051:	00 
c0100052:	c7 04 24 00 c0 11 c0 	movl   $0xc011c000,(%esp)
c0100059:	e8 f0 5e 00 00       	call   c0105f4e <memset>

    cons_init();                // init the console
c010005e:	e8 42 15 00 00       	call   c01015a5 <cons_init>

    const char *message = "(THU.CST) os is loading ...";
c0100063:	c7 45 f4 e0 60 10 c0 	movl   $0xc01060e0,-0xc(%ebp)
    cprintf("%s\n\n", message);
c010006a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010006d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100071:	c7 04 24 fc 60 10 c0 	movl   $0xc01060fc,(%esp)
c0100078:	e8 e9 02 00 00       	call   c0100366 <cprintf>

    print_kerninfo();
c010007d:	e8 07 08 00 00       	call   c0100889 <print_kerninfo>

    grade_backtrace();
c0100082:	e8 95 00 00 00       	call   c010011c <grade_backtrace>

    pmm_init();                 // init physical memory management
c0100087:	e8 39 44 00 00       	call   c01044c5 <pmm_init>

    pic_init();                 // init interrupt controller
c010008c:	e8 95 16 00 00       	call   c0101726 <pic_init>
    idt_init();                 // init interrupt descriptor table
c0100091:	e8 f9 17 00 00       	call   c010188f <idt_init>

    clock_init();               // init clock interrupt
c0100096:	e8 69 0c 00 00       	call   c0100d04 <clock_init>
    intr_enable();              // enable irq interrupt
c010009b:	e8 e4 15 00 00       	call   c0101684 <intr_enable>

    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    lab1_switch_test();
c01000a0:	e8 76 01 00 00       	call   c010021b <lab1_switch_test>

    /* do nothing */
    while (1);
c01000a5:	eb fe                	jmp    c01000a5 <kern_init+0x6f>

c01000a7 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
c01000a7:	55                   	push   %ebp
c01000a8:	89 e5                	mov    %esp,%ebp
c01000aa:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
c01000ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01000b4:	00 
c01000b5:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01000bc:	00 
c01000bd:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01000c4:	e8 56 0b 00 00       	call   c0100c1f <mon_backtrace>
}
c01000c9:	90                   	nop
c01000ca:	89 ec                	mov    %ebp,%esp
c01000cc:	5d                   	pop    %ebp
c01000cd:	c3                   	ret    

c01000ce <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
c01000ce:	55                   	push   %ebp
c01000cf:	89 e5                	mov    %esp,%ebp
c01000d1:	83 ec 18             	sub    $0x18,%esp
c01000d4:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
c01000d7:	8d 4d 0c             	lea    0xc(%ebp),%ecx
c01000da:	8b 55 0c             	mov    0xc(%ebp),%edx
c01000dd:	8d 5d 08             	lea    0x8(%ebp),%ebx
c01000e0:	8b 45 08             	mov    0x8(%ebp),%eax
c01000e3:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01000e7:	89 54 24 08          	mov    %edx,0x8(%esp)
c01000eb:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c01000ef:	89 04 24             	mov    %eax,(%esp)
c01000f2:	e8 b0 ff ff ff       	call   c01000a7 <grade_backtrace2>
}
c01000f7:	90                   	nop
c01000f8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c01000fb:	89 ec                	mov    %ebp,%esp
c01000fd:	5d                   	pop    %ebp
c01000fe:	c3                   	ret    

c01000ff <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
c01000ff:	55                   	push   %ebp
c0100100:	89 e5                	mov    %esp,%ebp
c0100102:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
c0100105:	8b 45 10             	mov    0x10(%ebp),%eax
c0100108:	89 44 24 04          	mov    %eax,0x4(%esp)
c010010c:	8b 45 08             	mov    0x8(%ebp),%eax
c010010f:	89 04 24             	mov    %eax,(%esp)
c0100112:	e8 b7 ff ff ff       	call   c01000ce <grade_backtrace1>
}
c0100117:	90                   	nop
c0100118:	89 ec                	mov    %ebp,%esp
c010011a:	5d                   	pop    %ebp
c010011b:	c3                   	ret    

c010011c <grade_backtrace>:

void
grade_backtrace(void) {
c010011c:	55                   	push   %ebp
c010011d:	89 e5                	mov    %esp,%ebp
c010011f:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
c0100122:	b8 36 00 10 c0       	mov    $0xc0100036,%eax
c0100127:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
c010012e:	ff 
c010012f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100133:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010013a:	e8 c0 ff ff ff       	call   c01000ff <grade_backtrace0>
}
c010013f:	90                   	nop
c0100140:	89 ec                	mov    %ebp,%esp
c0100142:	5d                   	pop    %ebp
c0100143:	c3                   	ret    

c0100144 <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
c0100144:	55                   	push   %ebp
c0100145:	89 e5                	mov    %esp,%ebp
c0100147:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
c010014a:	8c 4d f6             	mov    %cs,-0xa(%ebp)
c010014d:	8c 5d f4             	mov    %ds,-0xc(%ebp)
c0100150:	8c 45 f2             	mov    %es,-0xe(%ebp)
c0100153:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
c0100156:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010015a:	83 e0 03             	and    $0x3,%eax
c010015d:	89 c2                	mov    %eax,%edx
c010015f:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c0100164:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100168:	89 44 24 04          	mov    %eax,0x4(%esp)
c010016c:	c7 04 24 01 61 10 c0 	movl   $0xc0106101,(%esp)
c0100173:	e8 ee 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
c0100178:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010017c:	89 c2                	mov    %eax,%edx
c010017e:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c0100183:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100187:	89 44 24 04          	mov    %eax,0x4(%esp)
c010018b:	c7 04 24 0f 61 10 c0 	movl   $0xc010610f,(%esp)
c0100192:	e8 cf 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
c0100197:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c010019b:	89 c2                	mov    %eax,%edx
c010019d:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001a2:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001a6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001aa:	c7 04 24 1d 61 10 c0 	movl   $0xc010611d,(%esp)
c01001b1:	e8 b0 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
c01001b6:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01001ba:	89 c2                	mov    %eax,%edx
c01001bc:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001c1:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001c5:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001c9:	c7 04 24 2b 61 10 c0 	movl   $0xc010612b,(%esp)
c01001d0:	e8 91 01 00 00       	call   c0100366 <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
c01001d5:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c01001d9:	89 c2                	mov    %eax,%edx
c01001db:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001e0:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001e4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001e8:	c7 04 24 39 61 10 c0 	movl   $0xc0106139,(%esp)
c01001ef:	e8 72 01 00 00       	call   c0100366 <cprintf>
    round ++;
c01001f4:	a1 00 c0 11 c0       	mov    0xc011c000,%eax
c01001f9:	40                   	inc    %eax
c01001fa:	a3 00 c0 11 c0       	mov    %eax,0xc011c000
}
c01001ff:	90                   	nop
c0100200:	89 ec                	mov    %ebp,%esp
c0100202:	5d                   	pop    %ebp
c0100203:	c3                   	ret    

c0100204 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
c0100204:	55                   	push   %ebp
c0100205:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
    asm volatile (
c0100207:	83 ec 08             	sub    $0x8,%esp
c010020a:	cd 78                	int    $0x78
c010020c:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp"
	    : 
	    : "i"(T_SWITCH_TOU)
	);
}
c010020e:	90                   	nop
c010020f:	5d                   	pop    %ebp
c0100210:	c3                   	ret    

c0100211 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
c0100211:	55                   	push   %ebp
c0100212:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
    asm volatile (
c0100214:	cd 79                	int    $0x79
c0100216:	89 ec                	mov    %ebp,%esp
	    "int %0 \n"
	    "movl %%ebp, %%esp \n"
	    : 
	    : "i"(T_SWITCH_TOK)
	);
}
c0100218:	90                   	nop
c0100219:	5d                   	pop    %ebp
c010021a:	c3                   	ret    

c010021b <lab1_switch_test>:

static void
lab1_switch_test(void) {
c010021b:	55                   	push   %ebp
c010021c:	89 e5                	mov    %esp,%ebp
c010021e:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
c0100221:	e8 1e ff ff ff       	call   c0100144 <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
c0100226:	c7 04 24 48 61 10 c0 	movl   $0xc0106148,(%esp)
c010022d:	e8 34 01 00 00       	call   c0100366 <cprintf>
    lab1_switch_to_user();
c0100232:	e8 cd ff ff ff       	call   c0100204 <lab1_switch_to_user>
    lab1_print_cur_status();
c0100237:	e8 08 ff ff ff       	call   c0100144 <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
c010023c:	c7 04 24 68 61 10 c0 	movl   $0xc0106168,(%esp)
c0100243:	e8 1e 01 00 00       	call   c0100366 <cprintf>
    lab1_switch_to_kernel();
c0100248:	e8 c4 ff ff ff       	call   c0100211 <lab1_switch_to_kernel>
    lab1_print_cur_status();
c010024d:	e8 f2 fe ff ff       	call   c0100144 <lab1_print_cur_status>
}
c0100252:	90                   	nop
c0100253:	89 ec                	mov    %ebp,%esp
c0100255:	5d                   	pop    %ebp
c0100256:	c3                   	ret    

c0100257 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c0100257:	55                   	push   %ebp
c0100258:	89 e5                	mov    %esp,%ebp
c010025a:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
c010025d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100261:	74 13                	je     c0100276 <readline+0x1f>
        cprintf("%s", prompt);
c0100263:	8b 45 08             	mov    0x8(%ebp),%eax
c0100266:	89 44 24 04          	mov    %eax,0x4(%esp)
c010026a:	c7 04 24 87 61 10 c0 	movl   $0xc0106187,(%esp)
c0100271:	e8 f0 00 00 00       	call   c0100366 <cprintf>
    }
    int i = 0, c;
c0100276:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
c010027d:	e8 73 01 00 00       	call   c01003f5 <getchar>
c0100282:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
c0100285:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100289:	79 07                	jns    c0100292 <readline+0x3b>
            return NULL;
c010028b:	b8 00 00 00 00       	mov    $0x0,%eax
c0100290:	eb 78                	jmp    c010030a <readline+0xb3>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c0100292:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
c0100296:	7e 28                	jle    c01002c0 <readline+0x69>
c0100298:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
c010029f:	7f 1f                	jg     c01002c0 <readline+0x69>
            cputchar(c);
c01002a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002a4:	89 04 24             	mov    %eax,(%esp)
c01002a7:	e8 e2 00 00 00       	call   c010038e <cputchar>
            buf[i ++] = c;
c01002ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01002af:	8d 50 01             	lea    0x1(%eax),%edx
c01002b2:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01002b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01002b8:	88 90 20 c0 11 c0    	mov    %dl,-0x3fee3fe0(%eax)
c01002be:	eb 45                	jmp    c0100305 <readline+0xae>
        }
        else if (c == '\b' && i > 0) {
c01002c0:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
c01002c4:	75 16                	jne    c01002dc <readline+0x85>
c01002c6:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01002ca:	7e 10                	jle    c01002dc <readline+0x85>
            cputchar(c);
c01002cc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002cf:	89 04 24             	mov    %eax,(%esp)
c01002d2:	e8 b7 00 00 00       	call   c010038e <cputchar>
            i --;
c01002d7:	ff 4d f4             	decl   -0xc(%ebp)
c01002da:	eb 29                	jmp    c0100305 <readline+0xae>
        }
        else if (c == '\n' || c == '\r') {
c01002dc:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
c01002e0:	74 06                	je     c01002e8 <readline+0x91>
c01002e2:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
c01002e6:	75 95                	jne    c010027d <readline+0x26>
            cputchar(c);
c01002e8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002eb:	89 04 24             	mov    %eax,(%esp)
c01002ee:	e8 9b 00 00 00       	call   c010038e <cputchar>
            buf[i] = '\0';
c01002f3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01002f6:	05 20 c0 11 c0       	add    $0xc011c020,%eax
c01002fb:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
c01002fe:	b8 20 c0 11 c0       	mov    $0xc011c020,%eax
c0100303:	eb 05                	jmp    c010030a <readline+0xb3>
        c = getchar();
c0100305:	e9 73 ff ff ff       	jmp    c010027d <readline+0x26>
        }
    }
}
c010030a:	89 ec                	mov    %ebp,%esp
c010030c:	5d                   	pop    %ebp
c010030d:	c3                   	ret    

c010030e <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c010030e:	55                   	push   %ebp
c010030f:	89 e5                	mov    %esp,%ebp
c0100311:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c0100314:	8b 45 08             	mov    0x8(%ebp),%eax
c0100317:	89 04 24             	mov    %eax,(%esp)
c010031a:	e8 b5 12 00 00       	call   c01015d4 <cons_putc>
    (*cnt) ++;
c010031f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100322:	8b 00                	mov    (%eax),%eax
c0100324:	8d 50 01             	lea    0x1(%eax),%edx
c0100327:	8b 45 0c             	mov    0xc(%ebp),%eax
c010032a:	89 10                	mov    %edx,(%eax)
}
c010032c:	90                   	nop
c010032d:	89 ec                	mov    %ebp,%esp
c010032f:	5d                   	pop    %ebp
c0100330:	c3                   	ret    

c0100331 <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c0100331:	55                   	push   %ebp
c0100332:	89 e5                	mov    %esp,%ebp
c0100334:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c0100337:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
c010033e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100341:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0100345:	8b 45 08             	mov    0x8(%ebp),%eax
c0100348:	89 44 24 08          	mov    %eax,0x8(%esp)
c010034c:	8d 45 f4             	lea    -0xc(%ebp),%eax
c010034f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100353:	c7 04 24 0e 03 10 c0 	movl   $0xc010030e,(%esp)
c010035a:	e8 1a 54 00 00       	call   c0105779 <vprintfmt>
    return cnt;
c010035f:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100362:	89 ec                	mov    %ebp,%esp
c0100364:	5d                   	pop    %ebp
c0100365:	c3                   	ret    

c0100366 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c0100366:	55                   	push   %ebp
c0100367:	89 e5                	mov    %esp,%ebp
c0100369:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c010036c:	8d 45 0c             	lea    0xc(%ebp),%eax
c010036f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
c0100372:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100375:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100379:	8b 45 08             	mov    0x8(%ebp),%eax
c010037c:	89 04 24             	mov    %eax,(%esp)
c010037f:	e8 ad ff ff ff       	call   c0100331 <vcprintf>
c0100384:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0100387:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010038a:	89 ec                	mov    %ebp,%esp
c010038c:	5d                   	pop    %ebp
c010038d:	c3                   	ret    

c010038e <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c010038e:	55                   	push   %ebp
c010038f:	89 e5                	mov    %esp,%ebp
c0100391:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c0100394:	8b 45 08             	mov    0x8(%ebp),%eax
c0100397:	89 04 24             	mov    %eax,(%esp)
c010039a:	e8 35 12 00 00       	call   c01015d4 <cons_putc>
}
c010039f:	90                   	nop
c01003a0:	89 ec                	mov    %ebp,%esp
c01003a2:	5d                   	pop    %ebp
c01003a3:	c3                   	ret    

c01003a4 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01003a4:	55                   	push   %ebp
c01003a5:	89 e5                	mov    %esp,%ebp
c01003a7:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c01003aa:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
c01003b1:	eb 13                	jmp    c01003c6 <cputs+0x22>
        cputch(c, &cnt);
c01003b3:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c01003b7:	8d 55 f0             	lea    -0x10(%ebp),%edx
c01003ba:	89 54 24 04          	mov    %edx,0x4(%esp)
c01003be:	89 04 24             	mov    %eax,(%esp)
c01003c1:	e8 48 ff ff ff       	call   c010030e <cputch>
    while ((c = *str ++) != '\0') {
c01003c6:	8b 45 08             	mov    0x8(%ebp),%eax
c01003c9:	8d 50 01             	lea    0x1(%eax),%edx
c01003cc:	89 55 08             	mov    %edx,0x8(%ebp)
c01003cf:	0f b6 00             	movzbl (%eax),%eax
c01003d2:	88 45 f7             	mov    %al,-0x9(%ebp)
c01003d5:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c01003d9:	75 d8                	jne    c01003b3 <cputs+0xf>
    }
    cputch('\n', &cnt);
c01003db:	8d 45 f0             	lea    -0x10(%ebp),%eax
c01003de:	89 44 24 04          	mov    %eax,0x4(%esp)
c01003e2:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
c01003e9:	e8 20 ff ff ff       	call   c010030e <cputch>
    return cnt;
c01003ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c01003f1:	89 ec                	mov    %ebp,%esp
c01003f3:	5d                   	pop    %ebp
c01003f4:	c3                   	ret    

c01003f5 <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c01003f5:	55                   	push   %ebp
c01003f6:	89 e5                	mov    %esp,%ebp
c01003f8:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
c01003fb:	90                   	nop
c01003fc:	e8 12 12 00 00       	call   c0101613 <cons_getc>
c0100401:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100404:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100408:	74 f2                	je     c01003fc <getchar+0x7>
        /* do nothing */;
    return c;
c010040a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010040d:	89 ec                	mov    %ebp,%esp
c010040f:	5d                   	pop    %ebp
c0100410:	c3                   	ret    

c0100411 <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
c0100411:	55                   	push   %ebp
c0100412:	89 e5                	mov    %esp,%ebp
c0100414:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
c0100417:	8b 45 0c             	mov    0xc(%ebp),%eax
c010041a:	8b 00                	mov    (%eax),%eax
c010041c:	89 45 fc             	mov    %eax,-0x4(%ebp)
c010041f:	8b 45 10             	mov    0x10(%ebp),%eax
c0100422:	8b 00                	mov    (%eax),%eax
c0100424:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0100427:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
c010042e:	e9 ca 00 00 00       	jmp    c01004fd <stab_binsearch+0xec>
        int true_m = (l + r) / 2, m = true_m;
c0100433:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100436:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100439:	01 d0                	add    %edx,%eax
c010043b:	89 c2                	mov    %eax,%edx
c010043d:	c1 ea 1f             	shr    $0x1f,%edx
c0100440:	01 d0                	add    %edx,%eax
c0100442:	d1 f8                	sar    %eax
c0100444:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0100447:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010044a:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c010044d:	eb 03                	jmp    c0100452 <stab_binsearch+0x41>
            m --;
c010044f:	ff 4d f0             	decl   -0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
c0100452:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100455:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100458:	7c 1f                	jl     c0100479 <stab_binsearch+0x68>
c010045a:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010045d:	89 d0                	mov    %edx,%eax
c010045f:	01 c0                	add    %eax,%eax
c0100461:	01 d0                	add    %edx,%eax
c0100463:	c1 e0 02             	shl    $0x2,%eax
c0100466:	89 c2                	mov    %eax,%edx
c0100468:	8b 45 08             	mov    0x8(%ebp),%eax
c010046b:	01 d0                	add    %edx,%eax
c010046d:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100471:	0f b6 c0             	movzbl %al,%eax
c0100474:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100477:	75 d6                	jne    c010044f <stab_binsearch+0x3e>
        }
        if (m < l) {    // no match in [l, m]
c0100479:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010047c:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c010047f:	7d 09                	jge    c010048a <stab_binsearch+0x79>
            l = true_m + 1;
c0100481:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100484:	40                   	inc    %eax
c0100485:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
c0100488:	eb 73                	jmp    c01004fd <stab_binsearch+0xec>
        }

        // actual binary search
        any_matches = 1;
c010048a:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
c0100491:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100494:	89 d0                	mov    %edx,%eax
c0100496:	01 c0                	add    %eax,%eax
c0100498:	01 d0                	add    %edx,%eax
c010049a:	c1 e0 02             	shl    $0x2,%eax
c010049d:	89 c2                	mov    %eax,%edx
c010049f:	8b 45 08             	mov    0x8(%ebp),%eax
c01004a2:	01 d0                	add    %edx,%eax
c01004a4:	8b 40 08             	mov    0x8(%eax),%eax
c01004a7:	39 45 18             	cmp    %eax,0x18(%ebp)
c01004aa:	76 11                	jbe    c01004bd <stab_binsearch+0xac>
            *region_left = m;
c01004ac:	8b 45 0c             	mov    0xc(%ebp),%eax
c01004af:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004b2:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
c01004b4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01004b7:	40                   	inc    %eax
c01004b8:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01004bb:	eb 40                	jmp    c01004fd <stab_binsearch+0xec>
        } else if (stabs[m].n_value > addr) {
c01004bd:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004c0:	89 d0                	mov    %edx,%eax
c01004c2:	01 c0                	add    %eax,%eax
c01004c4:	01 d0                	add    %edx,%eax
c01004c6:	c1 e0 02             	shl    $0x2,%eax
c01004c9:	89 c2                	mov    %eax,%edx
c01004cb:	8b 45 08             	mov    0x8(%ebp),%eax
c01004ce:	01 d0                	add    %edx,%eax
c01004d0:	8b 40 08             	mov    0x8(%eax),%eax
c01004d3:	39 45 18             	cmp    %eax,0x18(%ebp)
c01004d6:	73 14                	jae    c01004ec <stab_binsearch+0xdb>
            *region_right = m - 1;
c01004d8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004db:	8d 50 ff             	lea    -0x1(%eax),%edx
c01004de:	8b 45 10             	mov    0x10(%ebp),%eax
c01004e1:	89 10                	mov    %edx,(%eax)
            r = m - 1;
c01004e3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004e6:	48                   	dec    %eax
c01004e7:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01004ea:	eb 11                	jmp    c01004fd <stab_binsearch+0xec>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
c01004ec:	8b 45 0c             	mov    0xc(%ebp),%eax
c01004ef:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01004f2:	89 10                	mov    %edx,(%eax)
            l = m;
c01004f4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01004f7:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
c01004fa:	ff 45 18             	incl   0x18(%ebp)
    while (l <= r) {
c01004fd:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100500:	3b 45 f8             	cmp    -0x8(%ebp),%eax
c0100503:	0f 8e 2a ff ff ff    	jle    c0100433 <stab_binsearch+0x22>
        }
    }

    if (!any_matches) {
c0100509:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010050d:	75 0f                	jne    c010051e <stab_binsearch+0x10d>
        *region_right = *region_left - 1;
c010050f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100512:	8b 00                	mov    (%eax),%eax
c0100514:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100517:	8b 45 10             	mov    0x10(%ebp),%eax
c010051a:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
c010051c:	eb 3e                	jmp    c010055c <stab_binsearch+0x14b>
        l = *region_right;
c010051e:	8b 45 10             	mov    0x10(%ebp),%eax
c0100521:	8b 00                	mov    (%eax),%eax
c0100523:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
c0100526:	eb 03                	jmp    c010052b <stab_binsearch+0x11a>
c0100528:	ff 4d fc             	decl   -0x4(%ebp)
c010052b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010052e:	8b 00                	mov    (%eax),%eax
c0100530:	39 45 fc             	cmp    %eax,-0x4(%ebp)
c0100533:	7e 1f                	jle    c0100554 <stab_binsearch+0x143>
c0100535:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100538:	89 d0                	mov    %edx,%eax
c010053a:	01 c0                	add    %eax,%eax
c010053c:	01 d0                	add    %edx,%eax
c010053e:	c1 e0 02             	shl    $0x2,%eax
c0100541:	89 c2                	mov    %eax,%edx
c0100543:	8b 45 08             	mov    0x8(%ebp),%eax
c0100546:	01 d0                	add    %edx,%eax
c0100548:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010054c:	0f b6 c0             	movzbl %al,%eax
c010054f:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100552:	75 d4                	jne    c0100528 <stab_binsearch+0x117>
        *region_left = l;
c0100554:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100557:	8b 55 fc             	mov    -0x4(%ebp),%edx
c010055a:	89 10                	mov    %edx,(%eax)
}
c010055c:	90                   	nop
c010055d:	89 ec                	mov    %ebp,%esp
c010055f:	5d                   	pop    %ebp
c0100560:	c3                   	ret    

c0100561 <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c0100561:	55                   	push   %ebp
c0100562:	89 e5                	mov    %esp,%ebp
c0100564:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
c0100567:	8b 45 0c             	mov    0xc(%ebp),%eax
c010056a:	c7 00 8c 61 10 c0    	movl   $0xc010618c,(%eax)
    info->eip_line = 0;
c0100570:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100573:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
c010057a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010057d:	c7 40 08 8c 61 10 c0 	movl   $0xc010618c,0x8(%eax)
    info->eip_fn_namelen = 9;
c0100584:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100587:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
c010058e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100591:	8b 55 08             	mov    0x8(%ebp),%edx
c0100594:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
c0100597:	8b 45 0c             	mov    0xc(%ebp),%eax
c010059a:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
c01005a1:	c7 45 f4 e0 73 10 c0 	movl   $0xc01073e0,-0xc(%ebp)
    stab_end = __STAB_END__;
c01005a8:	c7 45 f0 94 2b 11 c0 	movl   $0xc0112b94,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
c01005af:	c7 45 ec 95 2b 11 c0 	movl   $0xc0112b95,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
c01005b6:	c7 45 e8 2c 61 11 c0 	movl   $0xc011612c,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c01005bd:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01005c0:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01005c3:	76 0b                	jbe    c01005d0 <debuginfo_eip+0x6f>
c01005c5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01005c8:	48                   	dec    %eax
c01005c9:	0f b6 00             	movzbl (%eax),%eax
c01005cc:	84 c0                	test   %al,%al
c01005ce:	74 0a                	je     c01005da <debuginfo_eip+0x79>
        return -1;
c01005d0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01005d5:	e9 ab 02 00 00       	jmp    c0100885 <debuginfo_eip+0x324>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
c01005da:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c01005e1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005e4:	2b 45 f4             	sub    -0xc(%ebp),%eax
c01005e7:	c1 f8 02             	sar    $0x2,%eax
c01005ea:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c01005f0:	48                   	dec    %eax
c01005f1:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c01005f4:	8b 45 08             	mov    0x8(%ebp),%eax
c01005f7:	89 44 24 10          	mov    %eax,0x10(%esp)
c01005fb:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
c0100602:	00 
c0100603:	8d 45 e0             	lea    -0x20(%ebp),%eax
c0100606:	89 44 24 08          	mov    %eax,0x8(%esp)
c010060a:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c010060d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100611:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100614:	89 04 24             	mov    %eax,(%esp)
c0100617:	e8 f5 fd ff ff       	call   c0100411 <stab_binsearch>
    if (lfile == 0)
c010061c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010061f:	85 c0                	test   %eax,%eax
c0100621:	75 0a                	jne    c010062d <debuginfo_eip+0xcc>
        return -1;
c0100623:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100628:	e9 58 02 00 00       	jmp    c0100885 <debuginfo_eip+0x324>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
c010062d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100630:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0100633:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0100636:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c0100639:	8b 45 08             	mov    0x8(%ebp),%eax
c010063c:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100640:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
c0100647:	00 
c0100648:	8d 45 d8             	lea    -0x28(%ebp),%eax
c010064b:	89 44 24 08          	mov    %eax,0x8(%esp)
c010064f:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100652:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100656:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100659:	89 04 24             	mov    %eax,(%esp)
c010065c:	e8 b0 fd ff ff       	call   c0100411 <stab_binsearch>

    if (lfun <= rfun) {
c0100661:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100664:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100667:	39 c2                	cmp    %eax,%edx
c0100669:	7f 78                	jg     c01006e3 <debuginfo_eip+0x182>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c010066b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010066e:	89 c2                	mov    %eax,%edx
c0100670:	89 d0                	mov    %edx,%eax
c0100672:	01 c0                	add    %eax,%eax
c0100674:	01 d0                	add    %edx,%eax
c0100676:	c1 e0 02             	shl    $0x2,%eax
c0100679:	89 c2                	mov    %eax,%edx
c010067b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010067e:	01 d0                	add    %edx,%eax
c0100680:	8b 10                	mov    (%eax),%edx
c0100682:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100685:	2b 45 ec             	sub    -0x14(%ebp),%eax
c0100688:	39 c2                	cmp    %eax,%edx
c010068a:	73 22                	jae    c01006ae <debuginfo_eip+0x14d>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c010068c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010068f:	89 c2                	mov    %eax,%edx
c0100691:	89 d0                	mov    %edx,%eax
c0100693:	01 c0                	add    %eax,%eax
c0100695:	01 d0                	add    %edx,%eax
c0100697:	c1 e0 02             	shl    $0x2,%eax
c010069a:	89 c2                	mov    %eax,%edx
c010069c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010069f:	01 d0                	add    %edx,%eax
c01006a1:	8b 10                	mov    (%eax),%edx
c01006a3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01006a6:	01 c2                	add    %eax,%edx
c01006a8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006ab:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
c01006ae:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006b1:	89 c2                	mov    %eax,%edx
c01006b3:	89 d0                	mov    %edx,%eax
c01006b5:	01 c0                	add    %eax,%eax
c01006b7:	01 d0                	add    %edx,%eax
c01006b9:	c1 e0 02             	shl    $0x2,%eax
c01006bc:	89 c2                	mov    %eax,%edx
c01006be:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01006c1:	01 d0                	add    %edx,%eax
c01006c3:	8b 50 08             	mov    0x8(%eax),%edx
c01006c6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006c9:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
c01006cc:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006cf:	8b 40 10             	mov    0x10(%eax),%eax
c01006d2:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
c01006d5:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01006d8:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
c01006db:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01006de:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01006e1:	eb 15                	jmp    c01006f8 <debuginfo_eip+0x197>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
c01006e3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006e6:	8b 55 08             	mov    0x8(%ebp),%edx
c01006e9:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
c01006ec:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01006ef:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
c01006f2:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01006f5:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c01006f8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01006fb:	8b 40 08             	mov    0x8(%eax),%eax
c01006fe:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
c0100705:	00 
c0100706:	89 04 24             	mov    %eax,(%esp)
c0100709:	e8 b8 56 00 00       	call   c0105dc6 <strfind>
c010070e:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100711:	8b 4a 08             	mov    0x8(%edx),%ecx
c0100714:	29 c8                	sub    %ecx,%eax
c0100716:	89 c2                	mov    %eax,%edx
c0100718:	8b 45 0c             	mov    0xc(%ebp),%eax
c010071b:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c010071e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100721:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100725:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
c010072c:	00 
c010072d:	8d 45 d0             	lea    -0x30(%ebp),%eax
c0100730:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100734:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c0100737:	89 44 24 04          	mov    %eax,0x4(%esp)
c010073b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010073e:	89 04 24             	mov    %eax,(%esp)
c0100741:	e8 cb fc ff ff       	call   c0100411 <stab_binsearch>
    if (lline <= rline) {
c0100746:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100749:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010074c:	39 c2                	cmp    %eax,%edx
c010074e:	7f 23                	jg     c0100773 <debuginfo_eip+0x212>
        info->eip_line = stabs[rline].n_desc;
c0100750:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0100753:	89 c2                	mov    %eax,%edx
c0100755:	89 d0                	mov    %edx,%eax
c0100757:	01 c0                	add    %eax,%eax
c0100759:	01 d0                	add    %edx,%eax
c010075b:	c1 e0 02             	shl    $0x2,%eax
c010075e:	89 c2                	mov    %eax,%edx
c0100760:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100763:	01 d0                	add    %edx,%eax
c0100765:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c0100769:	89 c2                	mov    %eax,%edx
c010076b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010076e:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c0100771:	eb 11                	jmp    c0100784 <debuginfo_eip+0x223>
        return -1;
c0100773:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100778:	e9 08 01 00 00       	jmp    c0100885 <debuginfo_eip+0x324>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
c010077d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100780:	48                   	dec    %eax
c0100781:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
c0100784:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100787:	8b 45 e4             	mov    -0x1c(%ebp),%eax
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c010078a:	39 c2                	cmp    %eax,%edx
c010078c:	7c 56                	jl     c01007e4 <debuginfo_eip+0x283>
           && stabs[lline].n_type != N_SOL
c010078e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100791:	89 c2                	mov    %eax,%edx
c0100793:	89 d0                	mov    %edx,%eax
c0100795:	01 c0                	add    %eax,%eax
c0100797:	01 d0                	add    %edx,%eax
c0100799:	c1 e0 02             	shl    $0x2,%eax
c010079c:	89 c2                	mov    %eax,%edx
c010079e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007a1:	01 d0                	add    %edx,%eax
c01007a3:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01007a7:	3c 84                	cmp    $0x84,%al
c01007a9:	74 39                	je     c01007e4 <debuginfo_eip+0x283>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c01007ab:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007ae:	89 c2                	mov    %eax,%edx
c01007b0:	89 d0                	mov    %edx,%eax
c01007b2:	01 c0                	add    %eax,%eax
c01007b4:	01 d0                	add    %edx,%eax
c01007b6:	c1 e0 02             	shl    $0x2,%eax
c01007b9:	89 c2                	mov    %eax,%edx
c01007bb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007be:	01 d0                	add    %edx,%eax
c01007c0:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01007c4:	3c 64                	cmp    $0x64,%al
c01007c6:	75 b5                	jne    c010077d <debuginfo_eip+0x21c>
c01007c8:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007cb:	89 c2                	mov    %eax,%edx
c01007cd:	89 d0                	mov    %edx,%eax
c01007cf:	01 c0                	add    %eax,%eax
c01007d1:	01 d0                	add    %edx,%eax
c01007d3:	c1 e0 02             	shl    $0x2,%eax
c01007d6:	89 c2                	mov    %eax,%edx
c01007d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007db:	01 d0                	add    %edx,%eax
c01007dd:	8b 40 08             	mov    0x8(%eax),%eax
c01007e0:	85 c0                	test   %eax,%eax
c01007e2:	74 99                	je     c010077d <debuginfo_eip+0x21c>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c01007e4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01007e7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01007ea:	39 c2                	cmp    %eax,%edx
c01007ec:	7c 42                	jl     c0100830 <debuginfo_eip+0x2cf>
c01007ee:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01007f1:	89 c2                	mov    %eax,%edx
c01007f3:	89 d0                	mov    %edx,%eax
c01007f5:	01 c0                	add    %eax,%eax
c01007f7:	01 d0                	add    %edx,%eax
c01007f9:	c1 e0 02             	shl    $0x2,%eax
c01007fc:	89 c2                	mov    %eax,%edx
c01007fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100801:	01 d0                	add    %edx,%eax
c0100803:	8b 10                	mov    (%eax),%edx
c0100805:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100808:	2b 45 ec             	sub    -0x14(%ebp),%eax
c010080b:	39 c2                	cmp    %eax,%edx
c010080d:	73 21                	jae    c0100830 <debuginfo_eip+0x2cf>
        info->eip_file = stabstr + stabs[lline].n_strx;
c010080f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100812:	89 c2                	mov    %eax,%edx
c0100814:	89 d0                	mov    %edx,%eax
c0100816:	01 c0                	add    %eax,%eax
c0100818:	01 d0                	add    %edx,%eax
c010081a:	c1 e0 02             	shl    $0x2,%eax
c010081d:	89 c2                	mov    %eax,%edx
c010081f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100822:	01 d0                	add    %edx,%eax
c0100824:	8b 10                	mov    (%eax),%edx
c0100826:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100829:	01 c2                	add    %eax,%edx
c010082b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010082e:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
c0100830:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100833:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100836:	39 c2                	cmp    %eax,%edx
c0100838:	7d 46                	jge    c0100880 <debuginfo_eip+0x31f>
        for (lline = lfun + 1;
c010083a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010083d:	40                   	inc    %eax
c010083e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0100841:	eb 16                	jmp    c0100859 <debuginfo_eip+0x2f8>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
c0100843:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100846:	8b 40 14             	mov    0x14(%eax),%eax
c0100849:	8d 50 01             	lea    0x1(%eax),%edx
c010084c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010084f:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
c0100852:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100855:	40                   	inc    %eax
c0100856:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
c0100859:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010085c:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010085f:	39 c2                	cmp    %eax,%edx
c0100861:	7d 1d                	jge    c0100880 <debuginfo_eip+0x31f>
c0100863:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100866:	89 c2                	mov    %eax,%edx
c0100868:	89 d0                	mov    %edx,%eax
c010086a:	01 c0                	add    %eax,%eax
c010086c:	01 d0                	add    %edx,%eax
c010086e:	c1 e0 02             	shl    $0x2,%eax
c0100871:	89 c2                	mov    %eax,%edx
c0100873:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100876:	01 d0                	add    %edx,%eax
c0100878:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010087c:	3c a0                	cmp    $0xa0,%al
c010087e:	74 c3                	je     c0100843 <debuginfo_eip+0x2e2>
        }
    }
    return 0;
c0100880:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100885:	89 ec                	mov    %ebp,%esp
c0100887:	5d                   	pop    %ebp
c0100888:	c3                   	ret    

c0100889 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c0100889:	55                   	push   %ebp
c010088a:	89 e5                	mov    %esp,%ebp
c010088c:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
c010088f:	c7 04 24 96 61 10 c0 	movl   $0xc0106196,(%esp)
c0100896:	e8 cb fa ff ff       	call   c0100366 <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
c010089b:	c7 44 24 04 36 00 10 	movl   $0xc0100036,0x4(%esp)
c01008a2:	c0 
c01008a3:	c7 04 24 af 61 10 c0 	movl   $0xc01061af,(%esp)
c01008aa:	e8 b7 fa ff ff       	call   c0100366 <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
c01008af:	c7 44 24 04 da 60 10 	movl   $0xc01060da,0x4(%esp)
c01008b6:	c0 
c01008b7:	c7 04 24 c7 61 10 c0 	movl   $0xc01061c7,(%esp)
c01008be:	e8 a3 fa ff ff       	call   c0100366 <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
c01008c3:	c7 44 24 04 00 c0 11 	movl   $0xc011c000,0x4(%esp)
c01008ca:	c0 
c01008cb:	c7 04 24 df 61 10 c0 	movl   $0xc01061df,(%esp)
c01008d2:	e8 8f fa ff ff       	call   c0100366 <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
c01008d7:	c7 44 24 04 8c cf 11 	movl   $0xc011cf8c,0x4(%esp)
c01008de:	c0 
c01008df:	c7 04 24 f7 61 10 c0 	movl   $0xc01061f7,(%esp)
c01008e6:	e8 7b fa ff ff       	call   c0100366 <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c01008eb:	b8 8c cf 11 c0       	mov    $0xc011cf8c,%eax
c01008f0:	2d 36 00 10 c0       	sub    $0xc0100036,%eax
c01008f5:	05 ff 03 00 00       	add    $0x3ff,%eax
c01008fa:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c0100900:	85 c0                	test   %eax,%eax
c0100902:	0f 48 c2             	cmovs  %edx,%eax
c0100905:	c1 f8 0a             	sar    $0xa,%eax
c0100908:	89 44 24 04          	mov    %eax,0x4(%esp)
c010090c:	c7 04 24 10 62 10 c0 	movl   $0xc0106210,(%esp)
c0100913:	e8 4e fa ff ff       	call   c0100366 <cprintf>
}
c0100918:	90                   	nop
c0100919:	89 ec                	mov    %ebp,%esp
c010091b:	5d                   	pop    %ebp
c010091c:	c3                   	ret    

c010091d <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c010091d:	55                   	push   %ebp
c010091e:	89 e5                	mov    %esp,%ebp
c0100920:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
c0100926:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100929:	89 44 24 04          	mov    %eax,0x4(%esp)
c010092d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100930:	89 04 24             	mov    %eax,(%esp)
c0100933:	e8 29 fc ff ff       	call   c0100561 <debuginfo_eip>
c0100938:	85 c0                	test   %eax,%eax
c010093a:	74 15                	je     c0100951 <print_debuginfo+0x34>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
c010093c:	8b 45 08             	mov    0x8(%ebp),%eax
c010093f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100943:	c7 04 24 3a 62 10 c0 	movl   $0xc010623a,(%esp)
c010094a:	e8 17 fa ff ff       	call   c0100366 <cprintf>
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
c010094f:	eb 6c                	jmp    c01009bd <print_debuginfo+0xa0>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100951:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100958:	eb 1b                	jmp    c0100975 <print_debuginfo+0x58>
            fnname[j] = info.eip_fn_name[j];
c010095a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c010095d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100960:	01 d0                	add    %edx,%eax
c0100962:	0f b6 10             	movzbl (%eax),%edx
c0100965:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c010096b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010096e:	01 c8                	add    %ecx,%eax
c0100970:	88 10                	mov    %dl,(%eax)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100972:	ff 45 f4             	incl   -0xc(%ebp)
c0100975:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100978:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c010097b:	7c dd                	jl     c010095a <print_debuginfo+0x3d>
        fnname[j] = '\0';
c010097d:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
c0100983:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100986:	01 d0                	add    %edx,%eax
c0100988:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
c010098b:	8b 55 ec             	mov    -0x14(%ebp),%edx
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c010098e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100991:	29 d0                	sub    %edx,%eax
c0100993:	89 c1                	mov    %eax,%ecx
c0100995:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100998:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010099b:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c010099f:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c01009a5:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01009a9:	89 54 24 08          	mov    %edx,0x8(%esp)
c01009ad:	89 44 24 04          	mov    %eax,0x4(%esp)
c01009b1:	c7 04 24 56 62 10 c0 	movl   $0xc0106256,(%esp)
c01009b8:	e8 a9 f9 ff ff       	call   c0100366 <cprintf>
}
c01009bd:	90                   	nop
c01009be:	89 ec                	mov    %ebp,%esp
c01009c0:	5d                   	pop    %ebp
c01009c1:	c3                   	ret    

c01009c2 <read_eip>:

static __noinline uint32_t
read_eip(void) {
c01009c2:	55                   	push   %ebp
c01009c3:	89 e5                	mov    %esp,%ebp
c01009c5:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c01009c8:	8b 45 04             	mov    0x4(%ebp),%eax
c01009cb:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
c01009ce:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01009d1:	89 ec                	mov    %ebp,%esp
c01009d3:	5d                   	pop    %ebp
c01009d4:	c3                   	ret    

c01009d5 <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c01009d5:	55                   	push   %ebp
c01009d6:	89 e5                	mov    %esp,%ebp
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
}
c01009d8:	90                   	nop
c01009d9:	5d                   	pop    %ebp
c01009da:	c3                   	ret    

c01009db <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c01009db:	55                   	push   %ebp
c01009dc:	89 e5                	mov    %esp,%ebp
c01009de:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
c01009e1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c01009e8:	eb 0c                	jmp    c01009f6 <parse+0x1b>
            *buf ++ = '\0';
c01009ea:	8b 45 08             	mov    0x8(%ebp),%eax
c01009ed:	8d 50 01             	lea    0x1(%eax),%edx
c01009f0:	89 55 08             	mov    %edx,0x8(%ebp)
c01009f3:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c01009f6:	8b 45 08             	mov    0x8(%ebp),%eax
c01009f9:	0f b6 00             	movzbl (%eax),%eax
c01009fc:	84 c0                	test   %al,%al
c01009fe:	74 1d                	je     c0100a1d <parse+0x42>
c0100a00:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a03:	0f b6 00             	movzbl (%eax),%eax
c0100a06:	0f be c0             	movsbl %al,%eax
c0100a09:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a0d:	c7 04 24 e8 62 10 c0 	movl   $0xc01062e8,(%esp)
c0100a14:	e8 79 53 00 00       	call   c0105d92 <strchr>
c0100a19:	85 c0                	test   %eax,%eax
c0100a1b:	75 cd                	jne    c01009ea <parse+0xf>
        }
        if (*buf == '\0') {
c0100a1d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a20:	0f b6 00             	movzbl (%eax),%eax
c0100a23:	84 c0                	test   %al,%al
c0100a25:	74 65                	je     c0100a8c <parse+0xb1>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
c0100a27:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100a2b:	75 14                	jne    c0100a41 <parse+0x66>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100a2d:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
c0100a34:	00 
c0100a35:	c7 04 24 ed 62 10 c0 	movl   $0xc01062ed,(%esp)
c0100a3c:	e8 25 f9 ff ff       	call   c0100366 <cprintf>
        }
        argv[argc ++] = buf;
c0100a41:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a44:	8d 50 01             	lea    0x1(%eax),%edx
c0100a47:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0100a4a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0100a51:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100a54:	01 c2                	add    %eax,%edx
c0100a56:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a59:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100a5b:	eb 03                	jmp    c0100a60 <parse+0x85>
            buf ++;
c0100a5d:	ff 45 08             	incl   0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100a60:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a63:	0f b6 00             	movzbl (%eax),%eax
c0100a66:	84 c0                	test   %al,%al
c0100a68:	74 8c                	je     c01009f6 <parse+0x1b>
c0100a6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a6d:	0f b6 00             	movzbl (%eax),%eax
c0100a70:	0f be c0             	movsbl %al,%eax
c0100a73:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a77:	c7 04 24 e8 62 10 c0 	movl   $0xc01062e8,(%esp)
c0100a7e:	e8 0f 53 00 00       	call   c0105d92 <strchr>
c0100a83:	85 c0                	test   %eax,%eax
c0100a85:	74 d6                	je     c0100a5d <parse+0x82>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100a87:	e9 6a ff ff ff       	jmp    c01009f6 <parse+0x1b>
            break;
c0100a8c:	90                   	nop
        }
    }
    return argc;
c0100a8d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100a90:	89 ec                	mov    %ebp,%esp
c0100a92:	5d                   	pop    %ebp
c0100a93:	c3                   	ret    

c0100a94 <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100a94:	55                   	push   %ebp
c0100a95:	89 e5                	mov    %esp,%ebp
c0100a97:	83 ec 68             	sub    $0x68,%esp
c0100a9a:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
c0100a9d:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100aa0:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100aa4:	8b 45 08             	mov    0x8(%ebp),%eax
c0100aa7:	89 04 24             	mov    %eax,(%esp)
c0100aaa:	e8 2c ff ff ff       	call   c01009db <parse>
c0100aaf:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
c0100ab2:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100ab6:	75 0a                	jne    c0100ac2 <runcmd+0x2e>
        return 0;
c0100ab8:	b8 00 00 00 00       	mov    $0x0,%eax
c0100abd:	e9 83 00 00 00       	jmp    c0100b45 <runcmd+0xb1>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100ac2:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100ac9:	eb 5a                	jmp    c0100b25 <runcmd+0x91>
        if (strcmp(commands[i].name, argv[0]) == 0) {
c0100acb:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0100ace:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100ad1:	89 c8                	mov    %ecx,%eax
c0100ad3:	01 c0                	add    %eax,%eax
c0100ad5:	01 c8                	add    %ecx,%eax
c0100ad7:	c1 e0 02             	shl    $0x2,%eax
c0100ada:	05 00 90 11 c0       	add    $0xc0119000,%eax
c0100adf:	8b 00                	mov    (%eax),%eax
c0100ae1:	89 54 24 04          	mov    %edx,0x4(%esp)
c0100ae5:	89 04 24             	mov    %eax,(%esp)
c0100ae8:	e8 09 52 00 00       	call   c0105cf6 <strcmp>
c0100aed:	85 c0                	test   %eax,%eax
c0100aef:	75 31                	jne    c0100b22 <runcmd+0x8e>
            return commands[i].func(argc - 1, argv + 1, tf);
c0100af1:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100af4:	89 d0                	mov    %edx,%eax
c0100af6:	01 c0                	add    %eax,%eax
c0100af8:	01 d0                	add    %edx,%eax
c0100afa:	c1 e0 02             	shl    $0x2,%eax
c0100afd:	05 08 90 11 c0       	add    $0xc0119008,%eax
c0100b02:	8b 10                	mov    (%eax),%edx
c0100b04:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100b07:	83 c0 04             	add    $0x4,%eax
c0100b0a:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0100b0d:	8d 59 ff             	lea    -0x1(%ecx),%ebx
c0100b10:	8b 4d 0c             	mov    0xc(%ebp),%ecx
c0100b13:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0100b17:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b1b:	89 1c 24             	mov    %ebx,(%esp)
c0100b1e:	ff d2                	call   *%edx
c0100b20:	eb 23                	jmp    c0100b45 <runcmd+0xb1>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100b22:	ff 45 f4             	incl   -0xc(%ebp)
c0100b25:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b28:	83 f8 02             	cmp    $0x2,%eax
c0100b2b:	76 9e                	jbe    c0100acb <runcmd+0x37>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
c0100b2d:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0100b30:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b34:	c7 04 24 0b 63 10 c0 	movl   $0xc010630b,(%esp)
c0100b3b:	e8 26 f8 ff ff       	call   c0100366 <cprintf>
    return 0;
c0100b40:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100b45:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0100b48:	89 ec                	mov    %ebp,%esp
c0100b4a:	5d                   	pop    %ebp
c0100b4b:	c3                   	ret    

c0100b4c <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
c0100b4c:	55                   	push   %ebp
c0100b4d:	89 e5                	mov    %esp,%ebp
c0100b4f:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
c0100b52:	c7 04 24 24 63 10 c0 	movl   $0xc0106324,(%esp)
c0100b59:	e8 08 f8 ff ff       	call   c0100366 <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
c0100b5e:	c7 04 24 4c 63 10 c0 	movl   $0xc010634c,(%esp)
c0100b65:	e8 fc f7 ff ff       	call   c0100366 <cprintf>

    if (tf != NULL) {
c0100b6a:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100b6e:	74 0b                	je     c0100b7b <kmonitor+0x2f>
        print_trapframe(tf);
c0100b70:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b73:	89 04 24             	mov    %eax,(%esp)
c0100b76:	e8 cf 0e 00 00       	call   c0101a4a <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
c0100b7b:	c7 04 24 71 63 10 c0 	movl   $0xc0106371,(%esp)
c0100b82:	e8 d0 f6 ff ff       	call   c0100257 <readline>
c0100b87:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100b8a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100b8e:	74 eb                	je     c0100b7b <kmonitor+0x2f>
            if (runcmd(buf, tf) < 0) {
c0100b90:	8b 45 08             	mov    0x8(%ebp),%eax
c0100b93:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b97:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b9a:	89 04 24             	mov    %eax,(%esp)
c0100b9d:	e8 f2 fe ff ff       	call   c0100a94 <runcmd>
c0100ba2:	85 c0                	test   %eax,%eax
c0100ba4:	78 02                	js     c0100ba8 <kmonitor+0x5c>
        if ((buf = readline("K> ")) != NULL) {
c0100ba6:	eb d3                	jmp    c0100b7b <kmonitor+0x2f>
                break;
c0100ba8:	90                   	nop
            }
        }
    }
}
c0100ba9:	90                   	nop
c0100baa:	89 ec                	mov    %ebp,%esp
c0100bac:	5d                   	pop    %ebp
c0100bad:	c3                   	ret    

c0100bae <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c0100bae:	55                   	push   %ebp
c0100baf:	89 e5                	mov    %esp,%ebp
c0100bb1:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100bb4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100bbb:	eb 3d                	jmp    c0100bfa <mon_help+0x4c>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c0100bbd:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100bc0:	89 d0                	mov    %edx,%eax
c0100bc2:	01 c0                	add    %eax,%eax
c0100bc4:	01 d0                	add    %edx,%eax
c0100bc6:	c1 e0 02             	shl    $0x2,%eax
c0100bc9:	05 04 90 11 c0       	add    $0xc0119004,%eax
c0100bce:	8b 10                	mov    (%eax),%edx
c0100bd0:	8b 4d f4             	mov    -0xc(%ebp),%ecx
c0100bd3:	89 c8                	mov    %ecx,%eax
c0100bd5:	01 c0                	add    %eax,%eax
c0100bd7:	01 c8                	add    %ecx,%eax
c0100bd9:	c1 e0 02             	shl    $0x2,%eax
c0100bdc:	05 00 90 11 c0       	add    $0xc0119000,%eax
c0100be1:	8b 00                	mov    (%eax),%eax
c0100be3:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100be7:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100beb:	c7 04 24 75 63 10 c0 	movl   $0xc0106375,(%esp)
c0100bf2:	e8 6f f7 ff ff       	call   c0100366 <cprintf>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100bf7:	ff 45 f4             	incl   -0xc(%ebp)
c0100bfa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100bfd:	83 f8 02             	cmp    $0x2,%eax
c0100c00:	76 bb                	jbe    c0100bbd <mon_help+0xf>
    }
    return 0;
c0100c02:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100c07:	89 ec                	mov    %ebp,%esp
c0100c09:	5d                   	pop    %ebp
c0100c0a:	c3                   	ret    

c0100c0b <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c0100c0b:	55                   	push   %ebp
c0100c0c:	89 e5                	mov    %esp,%ebp
c0100c0e:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
c0100c11:	e8 73 fc ff ff       	call   c0100889 <print_kerninfo>
    return 0;
c0100c16:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100c1b:	89 ec                	mov    %ebp,%esp
c0100c1d:	5d                   	pop    %ebp
c0100c1e:	c3                   	ret    

c0100c1f <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c0100c1f:	55                   	push   %ebp
c0100c20:	89 e5                	mov    %esp,%ebp
c0100c22:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
c0100c25:	e8 ab fd ff ff       	call   c01009d5 <print_stackframe>
    return 0;
c0100c2a:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100c2f:	89 ec                	mov    %ebp,%esp
c0100c31:	5d                   	pop    %ebp
c0100c32:	c3                   	ret    

c0100c33 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0100c33:	55                   	push   %ebp
c0100c34:	89 e5                	mov    %esp,%ebp
c0100c36:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
c0100c39:	a1 20 c4 11 c0       	mov    0xc011c420,%eax
c0100c3e:	85 c0                	test   %eax,%eax
c0100c40:	75 5b                	jne    c0100c9d <__panic+0x6a>
        goto panic_dead;
    }
    is_panic = 1;
c0100c42:	c7 05 20 c4 11 c0 01 	movl   $0x1,0xc011c420
c0100c49:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
c0100c4c:	8d 45 14             	lea    0x14(%ebp),%eax
c0100c4f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
c0100c52:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100c55:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100c59:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c5c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100c60:	c7 04 24 7e 63 10 c0 	movl   $0xc010637e,(%esp)
c0100c67:	e8 fa f6 ff ff       	call   c0100366 <cprintf>
    vcprintf(fmt, ap);
c0100c6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c6f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100c73:	8b 45 10             	mov    0x10(%ebp),%eax
c0100c76:	89 04 24             	mov    %eax,(%esp)
c0100c79:	e8 b3 f6 ff ff       	call   c0100331 <vcprintf>
    cprintf("\n");
c0100c7e:	c7 04 24 9a 63 10 c0 	movl   $0xc010639a,(%esp)
c0100c85:	e8 dc f6 ff ff       	call   c0100366 <cprintf>
    
    cprintf("stack trackback:\n");
c0100c8a:	c7 04 24 9c 63 10 c0 	movl   $0xc010639c,(%esp)
c0100c91:	e8 d0 f6 ff ff       	call   c0100366 <cprintf>
    print_stackframe();
c0100c96:	e8 3a fd ff ff       	call   c01009d5 <print_stackframe>
c0100c9b:	eb 01                	jmp    c0100c9e <__panic+0x6b>
        goto panic_dead;
c0100c9d:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
c0100c9e:	e8 e9 09 00 00       	call   c010168c <intr_disable>
    while (1) {
        kmonitor(NULL);
c0100ca3:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0100caa:	e8 9d fe ff ff       	call   c0100b4c <kmonitor>
c0100caf:	eb f2                	jmp    c0100ca3 <__panic+0x70>

c0100cb1 <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c0100cb1:	55                   	push   %ebp
c0100cb2:	89 e5                	mov    %esp,%ebp
c0100cb4:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
c0100cb7:	8d 45 14             	lea    0x14(%ebp),%eax
c0100cba:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
c0100cbd:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100cc0:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100cc4:	8b 45 08             	mov    0x8(%ebp),%eax
c0100cc7:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100ccb:	c7 04 24 ae 63 10 c0 	movl   $0xc01063ae,(%esp)
c0100cd2:	e8 8f f6 ff ff       	call   c0100366 <cprintf>
    vcprintf(fmt, ap);
c0100cd7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100cda:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100cde:	8b 45 10             	mov    0x10(%ebp),%eax
c0100ce1:	89 04 24             	mov    %eax,(%esp)
c0100ce4:	e8 48 f6 ff ff       	call   c0100331 <vcprintf>
    cprintf("\n");
c0100ce9:	c7 04 24 9a 63 10 c0 	movl   $0xc010639a,(%esp)
c0100cf0:	e8 71 f6 ff ff       	call   c0100366 <cprintf>
    va_end(ap);
}
c0100cf5:	90                   	nop
c0100cf6:	89 ec                	mov    %ebp,%esp
c0100cf8:	5d                   	pop    %ebp
c0100cf9:	c3                   	ret    

c0100cfa <is_kernel_panic>:

bool
is_kernel_panic(void) {
c0100cfa:	55                   	push   %ebp
c0100cfb:	89 e5                	mov    %esp,%ebp
    return is_panic;
c0100cfd:	a1 20 c4 11 c0       	mov    0xc011c420,%eax
}
c0100d02:	5d                   	pop    %ebp
c0100d03:	c3                   	ret    

c0100d04 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c0100d04:	55                   	push   %ebp
c0100d05:	89 e5                	mov    %esp,%ebp
c0100d07:	83 ec 28             	sub    $0x28,%esp
c0100d0a:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
c0100d10:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
        : "memory", "cc");
}

static inline void
outb(uint16_t port, uint8_t data) {
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100d14:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100d18:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100d1c:	ee                   	out    %al,(%dx)
}
c0100d1d:	90                   	nop
c0100d1e:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c0100d24:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100d28:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100d2c:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0100d30:	ee                   	out    %al,(%dx)
}
c0100d31:	90                   	nop
c0100d32:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
c0100d38:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100d3c:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0100d40:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0100d44:	ee                   	out    %al,(%dx)
}
c0100d45:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
c0100d46:	c7 05 24 c4 11 c0 00 	movl   $0x0,0xc011c424
c0100d4d:	00 00 00 

    cprintf("++ setup timer interrupts\n");
c0100d50:	c7 04 24 cc 63 10 c0 	movl   $0xc01063cc,(%esp)
c0100d57:	e8 0a f6 ff ff       	call   c0100366 <cprintf>
    pic_enable(IRQ_TIMER);
c0100d5c:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0100d63:	e8 89 09 00 00       	call   c01016f1 <pic_enable>
}
c0100d68:	90                   	nop
c0100d69:	89 ec                	mov    %ebp,%esp
c0100d6b:	5d                   	pop    %ebp
c0100d6c:	c3                   	ret    

c0100d6d <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0100d6d:	55                   	push   %ebp
c0100d6e:	89 e5                	mov    %esp,%ebp
c0100d70:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0100d73:	9c                   	pushf  
c0100d74:	58                   	pop    %eax
c0100d75:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0100d78:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0100d7b:	25 00 02 00 00       	and    $0x200,%eax
c0100d80:	85 c0                	test   %eax,%eax
c0100d82:	74 0c                	je     c0100d90 <__intr_save+0x23>
        intr_disable();
c0100d84:	e8 03 09 00 00       	call   c010168c <intr_disable>
        return 1;
c0100d89:	b8 01 00 00 00       	mov    $0x1,%eax
c0100d8e:	eb 05                	jmp    c0100d95 <__intr_save+0x28>
    }
    return 0;
c0100d90:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100d95:	89 ec                	mov    %ebp,%esp
c0100d97:	5d                   	pop    %ebp
c0100d98:	c3                   	ret    

c0100d99 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0100d99:	55                   	push   %ebp
c0100d9a:	89 e5                	mov    %esp,%ebp
c0100d9c:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0100d9f:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100da3:	74 05                	je     c0100daa <__intr_restore+0x11>
        intr_enable();
c0100da5:	e8 da 08 00 00       	call   c0101684 <intr_enable>
    }
}
c0100daa:	90                   	nop
c0100dab:	89 ec                	mov    %ebp,%esp
c0100dad:	5d                   	pop    %ebp
c0100dae:	c3                   	ret    

c0100daf <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c0100daf:	55                   	push   %ebp
c0100db0:	89 e5                	mov    %esp,%ebp
c0100db2:	83 ec 10             	sub    $0x10,%esp
c0100db5:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100dbb:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100dbf:	89 c2                	mov    %eax,%edx
c0100dc1:	ec                   	in     (%dx),%al
c0100dc2:	88 45 f1             	mov    %al,-0xf(%ebp)
c0100dc5:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
c0100dcb:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100dcf:	89 c2                	mov    %eax,%edx
c0100dd1:	ec                   	in     (%dx),%al
c0100dd2:	88 45 f5             	mov    %al,-0xb(%ebp)
c0100dd5:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
c0100ddb:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0100ddf:	89 c2                	mov    %eax,%edx
c0100de1:	ec                   	in     (%dx),%al
c0100de2:	88 45 f9             	mov    %al,-0x7(%ebp)
c0100de5:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
c0100deb:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0100def:	89 c2                	mov    %eax,%edx
c0100df1:	ec                   	in     (%dx),%al
c0100df2:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
c0100df5:	90                   	nop
c0100df6:	89 ec                	mov    %ebp,%esp
c0100df8:	5d                   	pop    %ebp
c0100df9:	c3                   	ret    

c0100dfa <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c0100dfa:	55                   	push   %ebp
c0100dfb:	89 e5                	mov    %esp,%ebp
c0100dfd:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c0100e00:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
c0100e07:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e0a:	0f b7 00             	movzwl (%eax),%eax
c0100e0d:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
c0100e11:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e14:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
c0100e19:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e1c:	0f b7 00             	movzwl (%eax),%eax
c0100e1f:	0f b7 c0             	movzwl %ax,%eax
c0100e22:	3d 5a a5 00 00       	cmp    $0xa55a,%eax
c0100e27:	74 12                	je     c0100e3b <cga_init+0x41>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0100e29:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
c0100e30:	66 c7 05 46 c4 11 c0 	movw   $0x3b4,0xc011c446
c0100e37:	b4 03 
c0100e39:	eb 13                	jmp    c0100e4e <cga_init+0x54>
    } else {
        *cp = was;
c0100e3b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100e3e:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0100e42:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
c0100e45:	66 c7 05 46 c4 11 c0 	movw   $0x3d4,0xc011c446
c0100e4c:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
c0100e4e:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100e55:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0100e59:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100e5d:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0100e61:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0100e65:	ee                   	out    %al,(%dx)
}
c0100e66:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
c0100e67:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100e6e:	40                   	inc    %eax
c0100e6f:	0f b7 c0             	movzwl %ax,%eax
c0100e72:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100e76:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100e7a:	89 c2                	mov    %eax,%edx
c0100e7c:	ec                   	in     (%dx),%al
c0100e7d:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
c0100e80:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0100e84:	0f b6 c0             	movzbl %al,%eax
c0100e87:	c1 e0 08             	shl    $0x8,%eax
c0100e8a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
c0100e8d:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100e94:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0100e98:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100e9c:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100ea0:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100ea4:	ee                   	out    %al,(%dx)
}
c0100ea5:	90                   	nop
    pos |= inb(addr_6845 + 1);
c0100ea6:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0100ead:	40                   	inc    %eax
c0100eae:	0f b7 c0             	movzwl %ax,%eax
c0100eb1:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100eb5:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100eb9:	89 c2                	mov    %eax,%edx
c0100ebb:	ec                   	in     (%dx),%al
c0100ebc:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
c0100ebf:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100ec3:	0f b6 c0             	movzbl %al,%eax
c0100ec6:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
c0100ec9:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100ecc:	a3 40 c4 11 c0       	mov    %eax,0xc011c440
    crt_pos = pos;
c0100ed1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100ed4:	0f b7 c0             	movzwl %ax,%eax
c0100ed7:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
}
c0100edd:	90                   	nop
c0100ede:	89 ec                	mov    %ebp,%esp
c0100ee0:	5d                   	pop    %ebp
c0100ee1:	c3                   	ret    

c0100ee2 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c0100ee2:	55                   	push   %ebp
c0100ee3:	89 e5                	mov    %esp,%ebp
c0100ee5:	83 ec 48             	sub    $0x48,%esp
c0100ee8:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
c0100eee:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100ef2:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0100ef6:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0100efa:	ee                   	out    %al,(%dx)
}
c0100efb:	90                   	nop
c0100efc:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
c0100f02:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f06:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0100f0a:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0100f0e:	ee                   	out    %al,(%dx)
}
c0100f0f:	90                   	nop
c0100f10:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
c0100f16:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f1a:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0100f1e:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0100f22:	ee                   	out    %al,(%dx)
}
c0100f23:	90                   	nop
c0100f24:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0100f2a:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f2e:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c0100f32:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c0100f36:	ee                   	out    %al,(%dx)
}
c0100f37:	90                   	nop
c0100f38:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
c0100f3e:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f42:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c0100f46:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0100f4a:	ee                   	out    %al,(%dx)
}
c0100f4b:	90                   	nop
c0100f4c:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
c0100f52:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f56:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0100f5a:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0100f5e:	ee                   	out    %al,(%dx)
}
c0100f5f:	90                   	nop
c0100f60:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c0100f66:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f6a:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0100f6e:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0100f72:	ee                   	out    %al,(%dx)
}
c0100f73:	90                   	nop
c0100f74:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f7a:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c0100f7e:	89 c2                	mov    %eax,%edx
c0100f80:	ec                   	in     (%dx),%al
c0100f81:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
c0100f84:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c0100f88:	3c ff                	cmp    $0xff,%al
c0100f8a:	0f 95 c0             	setne  %al
c0100f8d:	0f b6 c0             	movzbl %al,%eax
c0100f90:	a3 48 c4 11 c0       	mov    %eax,0xc011c448
c0100f95:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f9b:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100f9f:	89 c2                	mov    %eax,%edx
c0100fa1:	ec                   	in     (%dx),%al
c0100fa2:	88 45 f1             	mov    %al,-0xf(%ebp)
c0100fa5:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c0100fab:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100faf:	89 c2                	mov    %eax,%edx
c0100fb1:	ec                   	in     (%dx),%al
c0100fb2:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
c0100fb5:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c0100fba:	85 c0                	test   %eax,%eax
c0100fbc:	74 0c                	je     c0100fca <serial_init+0xe8>
        pic_enable(IRQ_COM1);
c0100fbe:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c0100fc5:	e8 27 07 00 00       	call   c01016f1 <pic_enable>
    }
}
c0100fca:	90                   	nop
c0100fcb:	89 ec                	mov    %ebp,%esp
c0100fcd:	5d                   	pop    %ebp
c0100fce:	c3                   	ret    

c0100fcf <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c0100fcf:	55                   	push   %ebp
c0100fd0:	89 e5                	mov    %esp,%ebp
c0100fd2:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c0100fd5:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0100fdc:	eb 08                	jmp    c0100fe6 <lpt_putc_sub+0x17>
        delay();
c0100fde:	e8 cc fd ff ff       	call   c0100daf <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c0100fe3:	ff 45 fc             	incl   -0x4(%ebp)
c0100fe6:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
c0100fec:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0100ff0:	89 c2                	mov    %eax,%edx
c0100ff2:	ec                   	in     (%dx),%al
c0100ff3:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0100ff6:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0100ffa:	84 c0                	test   %al,%al
c0100ffc:	78 09                	js     c0101007 <lpt_putc_sub+0x38>
c0100ffe:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c0101005:	7e d7                	jle    c0100fde <lpt_putc_sub+0xf>
    }
    outb(LPTPORT + 0, c);
c0101007:	8b 45 08             	mov    0x8(%ebp),%eax
c010100a:	0f b6 c0             	movzbl %al,%eax
c010100d:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
c0101013:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101016:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c010101a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010101e:	ee                   	out    %al,(%dx)
}
c010101f:	90                   	nop
c0101020:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
c0101026:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010102a:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c010102e:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101032:	ee                   	out    %al,(%dx)
}
c0101033:	90                   	nop
c0101034:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
c010103a:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010103e:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101042:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101046:	ee                   	out    %al,(%dx)
}
c0101047:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
c0101048:	90                   	nop
c0101049:	89 ec                	mov    %ebp,%esp
c010104b:	5d                   	pop    %ebp
c010104c:	c3                   	ret    

c010104d <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c010104d:	55                   	push   %ebp
c010104e:	89 e5                	mov    %esp,%ebp
c0101050:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c0101053:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101057:	74 0d                	je     c0101066 <lpt_putc+0x19>
        lpt_putc_sub(c);
c0101059:	8b 45 08             	mov    0x8(%ebp),%eax
c010105c:	89 04 24             	mov    %eax,(%esp)
c010105f:	e8 6b ff ff ff       	call   c0100fcf <lpt_putc_sub>
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
c0101064:	eb 24                	jmp    c010108a <lpt_putc+0x3d>
        lpt_putc_sub('\b');
c0101066:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c010106d:	e8 5d ff ff ff       	call   c0100fcf <lpt_putc_sub>
        lpt_putc_sub(' ');
c0101072:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101079:	e8 51 ff ff ff       	call   c0100fcf <lpt_putc_sub>
        lpt_putc_sub('\b');
c010107e:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101085:	e8 45 ff ff ff       	call   c0100fcf <lpt_putc_sub>
}
c010108a:	90                   	nop
c010108b:	89 ec                	mov    %ebp,%esp
c010108d:	5d                   	pop    %ebp
c010108e:	c3                   	ret    

c010108f <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c010108f:	55                   	push   %ebp
c0101090:	89 e5                	mov    %esp,%ebp
c0101092:	83 ec 38             	sub    $0x38,%esp
c0101095:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    // set black on white
    if (!(c & ~0xFF)) {
c0101098:	8b 45 08             	mov    0x8(%ebp),%eax
c010109b:	25 00 ff ff ff       	and    $0xffffff00,%eax
c01010a0:	85 c0                	test   %eax,%eax
c01010a2:	75 07                	jne    c01010ab <cga_putc+0x1c>
        c |= 0x0700;
c01010a4:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
c01010ab:	8b 45 08             	mov    0x8(%ebp),%eax
c01010ae:	0f b6 c0             	movzbl %al,%eax
c01010b1:	83 f8 0d             	cmp    $0xd,%eax
c01010b4:	74 72                	je     c0101128 <cga_putc+0x99>
c01010b6:	83 f8 0d             	cmp    $0xd,%eax
c01010b9:	0f 8f a3 00 00 00    	jg     c0101162 <cga_putc+0xd3>
c01010bf:	83 f8 08             	cmp    $0x8,%eax
c01010c2:	74 0a                	je     c01010ce <cga_putc+0x3f>
c01010c4:	83 f8 0a             	cmp    $0xa,%eax
c01010c7:	74 4c                	je     c0101115 <cga_putc+0x86>
c01010c9:	e9 94 00 00 00       	jmp    c0101162 <cga_putc+0xd3>
    case '\b':
        if (crt_pos > 0) {
c01010ce:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01010d5:	85 c0                	test   %eax,%eax
c01010d7:	0f 84 af 00 00 00    	je     c010118c <cga_putc+0xfd>
            crt_pos --;
c01010dd:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01010e4:	48                   	dec    %eax
c01010e5:	0f b7 c0             	movzwl %ax,%eax
c01010e8:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
c01010ee:	8b 45 08             	mov    0x8(%ebp),%eax
c01010f1:	98                   	cwtl   
c01010f2:	25 00 ff ff ff       	and    $0xffffff00,%eax
c01010f7:	98                   	cwtl   
c01010f8:	83 c8 20             	or     $0x20,%eax
c01010fb:	98                   	cwtl   
c01010fc:	8b 0d 40 c4 11 c0    	mov    0xc011c440,%ecx
c0101102:	0f b7 15 44 c4 11 c0 	movzwl 0xc011c444,%edx
c0101109:	01 d2                	add    %edx,%edx
c010110b:	01 ca                	add    %ecx,%edx
c010110d:	0f b7 c0             	movzwl %ax,%eax
c0101110:	66 89 02             	mov    %ax,(%edx)
        }
        break;
c0101113:	eb 77                	jmp    c010118c <cga_putc+0xfd>
    case '\n':
        crt_pos += CRT_COLS;
c0101115:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010111c:	83 c0 50             	add    $0x50,%eax
c010111f:	0f b7 c0             	movzwl %ax,%eax
c0101122:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
c0101128:	0f b7 1d 44 c4 11 c0 	movzwl 0xc011c444,%ebx
c010112f:	0f b7 0d 44 c4 11 c0 	movzwl 0xc011c444,%ecx
c0101136:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
c010113b:	89 c8                	mov    %ecx,%eax
c010113d:	f7 e2                	mul    %edx
c010113f:	c1 ea 06             	shr    $0x6,%edx
c0101142:	89 d0                	mov    %edx,%eax
c0101144:	c1 e0 02             	shl    $0x2,%eax
c0101147:	01 d0                	add    %edx,%eax
c0101149:	c1 e0 04             	shl    $0x4,%eax
c010114c:	29 c1                	sub    %eax,%ecx
c010114e:	89 ca                	mov    %ecx,%edx
c0101150:	0f b7 d2             	movzwl %dx,%edx
c0101153:	89 d8                	mov    %ebx,%eax
c0101155:	29 d0                	sub    %edx,%eax
c0101157:	0f b7 c0             	movzwl %ax,%eax
c010115a:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
        break;
c0101160:	eb 2b                	jmp    c010118d <cga_putc+0xfe>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
c0101162:	8b 0d 40 c4 11 c0    	mov    0xc011c440,%ecx
c0101168:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010116f:	8d 50 01             	lea    0x1(%eax),%edx
c0101172:	0f b7 d2             	movzwl %dx,%edx
c0101175:	66 89 15 44 c4 11 c0 	mov    %dx,0xc011c444
c010117c:	01 c0                	add    %eax,%eax
c010117e:	8d 14 01             	lea    (%ecx,%eax,1),%edx
c0101181:	8b 45 08             	mov    0x8(%ebp),%eax
c0101184:	0f b7 c0             	movzwl %ax,%eax
c0101187:	66 89 02             	mov    %ax,(%edx)
        break;
c010118a:	eb 01                	jmp    c010118d <cga_putc+0xfe>
        break;
c010118c:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
c010118d:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c0101194:	3d cf 07 00 00       	cmp    $0x7cf,%eax
c0101199:	76 5e                	jbe    c01011f9 <cga_putc+0x16a>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c010119b:	a1 40 c4 11 c0       	mov    0xc011c440,%eax
c01011a0:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c01011a6:	a1 40 c4 11 c0       	mov    0xc011c440,%eax
c01011ab:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
c01011b2:	00 
c01011b3:	89 54 24 04          	mov    %edx,0x4(%esp)
c01011b7:	89 04 24             	mov    %eax,(%esp)
c01011ba:	e8 d1 4d 00 00       	call   c0105f90 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c01011bf:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
c01011c6:	eb 15                	jmp    c01011dd <cga_putc+0x14e>
            crt_buf[i] = 0x0700 | ' ';
c01011c8:	8b 15 40 c4 11 c0    	mov    0xc011c440,%edx
c01011ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01011d1:	01 c0                	add    %eax,%eax
c01011d3:	01 d0                	add    %edx,%eax
c01011d5:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c01011da:	ff 45 f4             	incl   -0xc(%ebp)
c01011dd:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
c01011e4:	7e e2                	jle    c01011c8 <cga_putc+0x139>
        }
        crt_pos -= CRT_COLS;
c01011e6:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c01011ed:	83 e8 50             	sub    $0x50,%eax
c01011f0:	0f b7 c0             	movzwl %ax,%eax
c01011f3:	66 a3 44 c4 11 c0    	mov    %ax,0xc011c444
    }

    // move that little blinky thing
    outb(addr_6845, 14);
c01011f9:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0101200:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0101204:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101208:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c010120c:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101210:	ee                   	out    %al,(%dx)
}
c0101211:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
c0101212:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c0101219:	c1 e8 08             	shr    $0x8,%eax
c010121c:	0f b7 c0             	movzwl %ax,%eax
c010121f:	0f b6 c0             	movzbl %al,%eax
c0101222:	0f b7 15 46 c4 11 c0 	movzwl 0xc011c446,%edx
c0101229:	42                   	inc    %edx
c010122a:	0f b7 d2             	movzwl %dx,%edx
c010122d:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c0101231:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101234:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101238:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c010123c:	ee                   	out    %al,(%dx)
}
c010123d:	90                   	nop
    outb(addr_6845, 15);
c010123e:	0f b7 05 46 c4 11 c0 	movzwl 0xc011c446,%eax
c0101245:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101249:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010124d:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101251:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101255:	ee                   	out    %al,(%dx)
}
c0101256:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
c0101257:	0f b7 05 44 c4 11 c0 	movzwl 0xc011c444,%eax
c010125e:	0f b6 c0             	movzbl %al,%eax
c0101261:	0f b7 15 46 c4 11 c0 	movzwl 0xc011c446,%edx
c0101268:	42                   	inc    %edx
c0101269:	0f b7 d2             	movzwl %dx,%edx
c010126c:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
c0101270:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101273:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101277:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010127b:	ee                   	out    %al,(%dx)
}
c010127c:	90                   	nop
}
c010127d:	90                   	nop
c010127e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0101281:	89 ec                	mov    %ebp,%esp
c0101283:	5d                   	pop    %ebp
c0101284:	c3                   	ret    

c0101285 <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c0101285:	55                   	push   %ebp
c0101286:	89 e5                	mov    %esp,%ebp
c0101288:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c010128b:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0101292:	eb 08                	jmp    c010129c <serial_putc_sub+0x17>
        delay();
c0101294:	e8 16 fb ff ff       	call   c0100daf <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101299:	ff 45 fc             	incl   -0x4(%ebp)
c010129c:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01012a2:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01012a6:	89 c2                	mov    %eax,%edx
c01012a8:	ec                   	in     (%dx),%al
c01012a9:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c01012ac:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01012b0:	0f b6 c0             	movzbl %al,%eax
c01012b3:	83 e0 20             	and    $0x20,%eax
c01012b6:	85 c0                	test   %eax,%eax
c01012b8:	75 09                	jne    c01012c3 <serial_putc_sub+0x3e>
c01012ba:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c01012c1:	7e d1                	jle    c0101294 <serial_putc_sub+0xf>
    }
    outb(COM1 + COM_TX, c);
c01012c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01012c6:	0f b6 c0             	movzbl %al,%eax
c01012c9:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c01012cf:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01012d2:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01012d6:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c01012da:	ee                   	out    %al,(%dx)
}
c01012db:	90                   	nop
}
c01012dc:	90                   	nop
c01012dd:	89 ec                	mov    %ebp,%esp
c01012df:	5d                   	pop    %ebp
c01012e0:	c3                   	ret    

c01012e1 <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c01012e1:	55                   	push   %ebp
c01012e2:	89 e5                	mov    %esp,%ebp
c01012e4:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c01012e7:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c01012eb:	74 0d                	je     c01012fa <serial_putc+0x19>
        serial_putc_sub(c);
c01012ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01012f0:	89 04 24             	mov    %eax,(%esp)
c01012f3:	e8 8d ff ff ff       	call   c0101285 <serial_putc_sub>
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
c01012f8:	eb 24                	jmp    c010131e <serial_putc+0x3d>
        serial_putc_sub('\b');
c01012fa:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101301:	e8 7f ff ff ff       	call   c0101285 <serial_putc_sub>
        serial_putc_sub(' ');
c0101306:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c010130d:	e8 73 ff ff ff       	call   c0101285 <serial_putc_sub>
        serial_putc_sub('\b');
c0101312:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101319:	e8 67 ff ff ff       	call   c0101285 <serial_putc_sub>
}
c010131e:	90                   	nop
c010131f:	89 ec                	mov    %ebp,%esp
c0101321:	5d                   	pop    %ebp
c0101322:	c3                   	ret    

c0101323 <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c0101323:	55                   	push   %ebp
c0101324:	89 e5                	mov    %esp,%ebp
c0101326:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
c0101329:	eb 33                	jmp    c010135e <cons_intr+0x3b>
        if (c != 0) {
c010132b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010132f:	74 2d                	je     c010135e <cons_intr+0x3b>
            cons.buf[cons.wpos ++] = c;
c0101331:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c0101336:	8d 50 01             	lea    0x1(%eax),%edx
c0101339:	89 15 64 c6 11 c0    	mov    %edx,0xc011c664
c010133f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101342:	88 90 60 c4 11 c0    	mov    %dl,-0x3fee3ba0(%eax)
            if (cons.wpos == CONSBUFSIZE) {
c0101348:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c010134d:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101352:	75 0a                	jne    c010135e <cons_intr+0x3b>
                cons.wpos = 0;
c0101354:	c7 05 64 c6 11 c0 00 	movl   $0x0,0xc011c664
c010135b:	00 00 00 
    while ((c = (*proc)()) != -1) {
c010135e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101361:	ff d0                	call   *%eax
c0101363:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101366:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c010136a:	75 bf                	jne    c010132b <cons_intr+0x8>
            }
        }
    }
}
c010136c:	90                   	nop
c010136d:	90                   	nop
c010136e:	89 ec                	mov    %ebp,%esp
c0101370:	5d                   	pop    %ebp
c0101371:	c3                   	ret    

c0101372 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c0101372:	55                   	push   %ebp
c0101373:	89 e5                	mov    %esp,%ebp
c0101375:	83 ec 10             	sub    $0x10,%esp
c0101378:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010137e:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101382:	89 c2                	mov    %eax,%edx
c0101384:	ec                   	in     (%dx),%al
c0101385:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c0101388:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c010138c:	0f b6 c0             	movzbl %al,%eax
c010138f:	83 e0 01             	and    $0x1,%eax
c0101392:	85 c0                	test   %eax,%eax
c0101394:	75 07                	jne    c010139d <serial_proc_data+0x2b>
        return -1;
c0101396:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c010139b:	eb 2a                	jmp    c01013c7 <serial_proc_data+0x55>
c010139d:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01013a3:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01013a7:	89 c2                	mov    %eax,%edx
c01013a9:	ec                   	in     (%dx),%al
c01013aa:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
c01013ad:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
c01013b1:	0f b6 c0             	movzbl %al,%eax
c01013b4:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
c01013b7:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
c01013bb:	75 07                	jne    c01013c4 <serial_proc_data+0x52>
        c = '\b';
c01013bd:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
c01013c4:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01013c7:	89 ec                	mov    %ebp,%esp
c01013c9:	5d                   	pop    %ebp
c01013ca:	c3                   	ret    

c01013cb <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c01013cb:	55                   	push   %ebp
c01013cc:	89 e5                	mov    %esp,%ebp
c01013ce:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
c01013d1:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c01013d6:	85 c0                	test   %eax,%eax
c01013d8:	74 0c                	je     c01013e6 <serial_intr+0x1b>
        cons_intr(serial_proc_data);
c01013da:	c7 04 24 72 13 10 c0 	movl   $0xc0101372,(%esp)
c01013e1:	e8 3d ff ff ff       	call   c0101323 <cons_intr>
    }
}
c01013e6:	90                   	nop
c01013e7:	89 ec                	mov    %ebp,%esp
c01013e9:	5d                   	pop    %ebp
c01013ea:	c3                   	ret    

c01013eb <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c01013eb:	55                   	push   %ebp
c01013ec:	89 e5                	mov    %esp,%ebp
c01013ee:	83 ec 38             	sub    $0x38,%esp
c01013f1:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01013f7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01013fa:	89 c2                	mov    %eax,%edx
c01013fc:	ec                   	in     (%dx),%al
c01013fd:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
c0101400:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
c0101404:	0f b6 c0             	movzbl %al,%eax
c0101407:	83 e0 01             	and    $0x1,%eax
c010140a:	85 c0                	test   %eax,%eax
c010140c:	75 0a                	jne    c0101418 <kbd_proc_data+0x2d>
        return -1;
c010140e:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101413:	e9 56 01 00 00       	jmp    c010156e <kbd_proc_data+0x183>
c0101418:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010141e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101421:	89 c2                	mov    %eax,%edx
c0101423:	ec                   	in     (%dx),%al
c0101424:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
c0101427:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
c010142b:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
c010142e:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
c0101432:	75 17                	jne    c010144b <kbd_proc_data+0x60>
        // E0 escape character
        shift |= E0ESC;
c0101434:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101439:	83 c8 40             	or     $0x40,%eax
c010143c:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
        return 0;
c0101441:	b8 00 00 00 00       	mov    $0x0,%eax
c0101446:	e9 23 01 00 00       	jmp    c010156e <kbd_proc_data+0x183>
    } else if (data & 0x80) {
c010144b:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010144f:	84 c0                	test   %al,%al
c0101451:	79 45                	jns    c0101498 <kbd_proc_data+0xad>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
c0101453:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101458:	83 e0 40             	and    $0x40,%eax
c010145b:	85 c0                	test   %eax,%eax
c010145d:	75 08                	jne    c0101467 <kbd_proc_data+0x7c>
c010145f:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101463:	24 7f                	and    $0x7f,%al
c0101465:	eb 04                	jmp    c010146b <kbd_proc_data+0x80>
c0101467:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c010146b:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
c010146e:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101472:	0f b6 80 40 90 11 c0 	movzbl -0x3fee6fc0(%eax),%eax
c0101479:	0c 40                	or     $0x40,%al
c010147b:	0f b6 c0             	movzbl %al,%eax
c010147e:	f7 d0                	not    %eax
c0101480:	89 c2                	mov    %eax,%edx
c0101482:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c0101487:	21 d0                	and    %edx,%eax
c0101489:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
        return 0;
c010148e:	b8 00 00 00 00       	mov    $0x0,%eax
c0101493:	e9 d6 00 00 00       	jmp    c010156e <kbd_proc_data+0x183>
    } else if (shift & E0ESC) {
c0101498:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c010149d:	83 e0 40             	and    $0x40,%eax
c01014a0:	85 c0                	test   %eax,%eax
c01014a2:	74 11                	je     c01014b5 <kbd_proc_data+0xca>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
c01014a4:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
c01014a8:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01014ad:	83 e0 bf             	and    $0xffffffbf,%eax
c01014b0:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
    }

    shift |= shiftcode[data];
c01014b5:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01014b9:	0f b6 80 40 90 11 c0 	movzbl -0x3fee6fc0(%eax),%eax
c01014c0:	0f b6 d0             	movzbl %al,%edx
c01014c3:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01014c8:	09 d0                	or     %edx,%eax
c01014ca:	a3 68 c6 11 c0       	mov    %eax,0xc011c668
    shift ^= togglecode[data];
c01014cf:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01014d3:	0f b6 80 40 91 11 c0 	movzbl -0x3fee6ec0(%eax),%eax
c01014da:	0f b6 d0             	movzbl %al,%edx
c01014dd:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01014e2:	31 d0                	xor    %edx,%eax
c01014e4:	a3 68 c6 11 c0       	mov    %eax,0xc011c668

    c = charcode[shift & (CTL | SHIFT)][data];
c01014e9:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c01014ee:	83 e0 03             	and    $0x3,%eax
c01014f1:	8b 14 85 40 95 11 c0 	mov    -0x3fee6ac0(,%eax,4),%edx
c01014f8:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01014fc:	01 d0                	add    %edx,%eax
c01014fe:	0f b6 00             	movzbl (%eax),%eax
c0101501:	0f b6 c0             	movzbl %al,%eax
c0101504:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
c0101507:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c010150c:	83 e0 08             	and    $0x8,%eax
c010150f:	85 c0                	test   %eax,%eax
c0101511:	74 22                	je     c0101535 <kbd_proc_data+0x14a>
        if ('a' <= c && c <= 'z')
c0101513:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
c0101517:	7e 0c                	jle    c0101525 <kbd_proc_data+0x13a>
c0101519:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
c010151d:	7f 06                	jg     c0101525 <kbd_proc_data+0x13a>
            c += 'A' - 'a';
c010151f:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
c0101523:	eb 10                	jmp    c0101535 <kbd_proc_data+0x14a>
        else if ('A' <= c && c <= 'Z')
c0101525:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
c0101529:	7e 0a                	jle    c0101535 <kbd_proc_data+0x14a>
c010152b:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
c010152f:	7f 04                	jg     c0101535 <kbd_proc_data+0x14a>
            c += 'a' - 'A';
c0101531:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c0101535:	a1 68 c6 11 c0       	mov    0xc011c668,%eax
c010153a:	f7 d0                	not    %eax
c010153c:	83 e0 06             	and    $0x6,%eax
c010153f:	85 c0                	test   %eax,%eax
c0101541:	75 28                	jne    c010156b <kbd_proc_data+0x180>
c0101543:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
c010154a:	75 1f                	jne    c010156b <kbd_proc_data+0x180>
        cprintf("Rebooting!\n");
c010154c:	c7 04 24 e7 63 10 c0 	movl   $0xc01063e7,(%esp)
c0101553:	e8 0e ee ff ff       	call   c0100366 <cprintf>
c0101558:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
c010155e:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101562:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
c0101566:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0101569:	ee                   	out    %al,(%dx)
}
c010156a:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
c010156b:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010156e:	89 ec                	mov    %ebp,%esp
c0101570:	5d                   	pop    %ebp
c0101571:	c3                   	ret    

c0101572 <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c0101572:	55                   	push   %ebp
c0101573:	89 e5                	mov    %esp,%ebp
c0101575:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
c0101578:	c7 04 24 eb 13 10 c0 	movl   $0xc01013eb,(%esp)
c010157f:	e8 9f fd ff ff       	call   c0101323 <cons_intr>
}
c0101584:	90                   	nop
c0101585:	89 ec                	mov    %ebp,%esp
c0101587:	5d                   	pop    %ebp
c0101588:	c3                   	ret    

c0101589 <kbd_init>:

static void
kbd_init(void) {
c0101589:	55                   	push   %ebp
c010158a:	89 e5                	mov    %esp,%ebp
c010158c:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
c010158f:	e8 de ff ff ff       	call   c0101572 <kbd_intr>
    pic_enable(IRQ_KBD);
c0101594:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010159b:	e8 51 01 00 00       	call   c01016f1 <pic_enable>
}
c01015a0:	90                   	nop
c01015a1:	89 ec                	mov    %ebp,%esp
c01015a3:	5d                   	pop    %ebp
c01015a4:	c3                   	ret    

c01015a5 <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c01015a5:	55                   	push   %ebp
c01015a6:	89 e5                	mov    %esp,%ebp
c01015a8:	83 ec 18             	sub    $0x18,%esp
    cga_init();
c01015ab:	e8 4a f8 ff ff       	call   c0100dfa <cga_init>
    serial_init();
c01015b0:	e8 2d f9 ff ff       	call   c0100ee2 <serial_init>
    kbd_init();
c01015b5:	e8 cf ff ff ff       	call   c0101589 <kbd_init>
    if (!serial_exists) {
c01015ba:	a1 48 c4 11 c0       	mov    0xc011c448,%eax
c01015bf:	85 c0                	test   %eax,%eax
c01015c1:	75 0c                	jne    c01015cf <cons_init+0x2a>
        cprintf("serial port does not exist!!\n");
c01015c3:	c7 04 24 f3 63 10 c0 	movl   $0xc01063f3,(%esp)
c01015ca:	e8 97 ed ff ff       	call   c0100366 <cprintf>
    }
}
c01015cf:	90                   	nop
c01015d0:	89 ec                	mov    %ebp,%esp
c01015d2:	5d                   	pop    %ebp
c01015d3:	c3                   	ret    

c01015d4 <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c01015d4:	55                   	push   %ebp
c01015d5:	89 e5                	mov    %esp,%ebp
c01015d7:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c01015da:	e8 8e f7 ff ff       	call   c0100d6d <__intr_save>
c01015df:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
c01015e2:	8b 45 08             	mov    0x8(%ebp),%eax
c01015e5:	89 04 24             	mov    %eax,(%esp)
c01015e8:	e8 60 fa ff ff       	call   c010104d <lpt_putc>
        cga_putc(c);
c01015ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01015f0:	89 04 24             	mov    %eax,(%esp)
c01015f3:	e8 97 fa ff ff       	call   c010108f <cga_putc>
        serial_putc(c);
c01015f8:	8b 45 08             	mov    0x8(%ebp),%eax
c01015fb:	89 04 24             	mov    %eax,(%esp)
c01015fe:	e8 de fc ff ff       	call   c01012e1 <serial_putc>
    }
    local_intr_restore(intr_flag);
c0101603:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101606:	89 04 24             	mov    %eax,(%esp)
c0101609:	e8 8b f7 ff ff       	call   c0100d99 <__intr_restore>
}
c010160e:	90                   	nop
c010160f:	89 ec                	mov    %ebp,%esp
c0101611:	5d                   	pop    %ebp
c0101612:	c3                   	ret    

c0101613 <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c0101613:	55                   	push   %ebp
c0101614:	89 e5                	mov    %esp,%ebp
c0101616:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
c0101619:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0101620:	e8 48 f7 ff ff       	call   c0100d6d <__intr_save>
c0101625:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
c0101628:	e8 9e fd ff ff       	call   c01013cb <serial_intr>
        kbd_intr();
c010162d:	e8 40 ff ff ff       	call   c0101572 <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
c0101632:	8b 15 60 c6 11 c0    	mov    0xc011c660,%edx
c0101638:	a1 64 c6 11 c0       	mov    0xc011c664,%eax
c010163d:	39 c2                	cmp    %eax,%edx
c010163f:	74 31                	je     c0101672 <cons_getc+0x5f>
            c = cons.buf[cons.rpos ++];
c0101641:	a1 60 c6 11 c0       	mov    0xc011c660,%eax
c0101646:	8d 50 01             	lea    0x1(%eax),%edx
c0101649:	89 15 60 c6 11 c0    	mov    %edx,0xc011c660
c010164f:	0f b6 80 60 c4 11 c0 	movzbl -0x3fee3ba0(%eax),%eax
c0101656:	0f b6 c0             	movzbl %al,%eax
c0101659:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
c010165c:	a1 60 c6 11 c0       	mov    0xc011c660,%eax
c0101661:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101666:	75 0a                	jne    c0101672 <cons_getc+0x5f>
                cons.rpos = 0;
c0101668:	c7 05 60 c6 11 c0 00 	movl   $0x0,0xc011c660
c010166f:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
c0101672:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101675:	89 04 24             	mov    %eax,(%esp)
c0101678:	e8 1c f7 ff ff       	call   c0100d99 <__intr_restore>
    return c;
c010167d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101680:	89 ec                	mov    %ebp,%esp
c0101682:	5d                   	pop    %ebp
c0101683:	c3                   	ret    

c0101684 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c0101684:	55                   	push   %ebp
c0101685:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
c0101687:	fb                   	sti    
}
c0101688:	90                   	nop
    sti();
}
c0101689:	90                   	nop
c010168a:	5d                   	pop    %ebp
c010168b:	c3                   	ret    

c010168c <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c010168c:	55                   	push   %ebp
c010168d:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
c010168f:	fa                   	cli    
}
c0101690:	90                   	nop
    cli();
}
c0101691:	90                   	nop
c0101692:	5d                   	pop    %ebp
c0101693:	c3                   	ret    

c0101694 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c0101694:	55                   	push   %ebp
c0101695:	89 e5                	mov    %esp,%ebp
c0101697:	83 ec 14             	sub    $0x14,%esp
c010169a:	8b 45 08             	mov    0x8(%ebp),%eax
c010169d:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
c01016a1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01016a4:	66 a3 50 95 11 c0    	mov    %ax,0xc0119550
    if (did_init) {
c01016aa:	a1 6c c6 11 c0       	mov    0xc011c66c,%eax
c01016af:	85 c0                	test   %eax,%eax
c01016b1:	74 39                	je     c01016ec <pic_setmask+0x58>
        outb(IO_PIC1 + 1, mask);
c01016b3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01016b6:	0f b6 c0             	movzbl %al,%eax
c01016b9:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
c01016bf:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01016c2:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01016c6:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01016ca:	ee                   	out    %al,(%dx)
}
c01016cb:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
c01016cc:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01016d0:	c1 e8 08             	shr    $0x8,%eax
c01016d3:	0f b7 c0             	movzwl %ax,%eax
c01016d6:	0f b6 c0             	movzbl %al,%eax
c01016d9:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
c01016df:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01016e2:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c01016e6:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c01016ea:	ee                   	out    %al,(%dx)
}
c01016eb:	90                   	nop
    }
}
c01016ec:	90                   	nop
c01016ed:	89 ec                	mov    %ebp,%esp
c01016ef:	5d                   	pop    %ebp
c01016f0:	c3                   	ret    

c01016f1 <pic_enable>:

void
pic_enable(unsigned int irq) {
c01016f1:	55                   	push   %ebp
c01016f2:	89 e5                	mov    %esp,%ebp
c01016f4:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
c01016f7:	8b 45 08             	mov    0x8(%ebp),%eax
c01016fa:	ba 01 00 00 00       	mov    $0x1,%edx
c01016ff:	88 c1                	mov    %al,%cl
c0101701:	d3 e2                	shl    %cl,%edx
c0101703:	89 d0                	mov    %edx,%eax
c0101705:	98                   	cwtl   
c0101706:	f7 d0                	not    %eax
c0101708:	0f bf d0             	movswl %ax,%edx
c010170b:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c0101712:	98                   	cwtl   
c0101713:	21 d0                	and    %edx,%eax
c0101715:	98                   	cwtl   
c0101716:	0f b7 c0             	movzwl %ax,%eax
c0101719:	89 04 24             	mov    %eax,(%esp)
c010171c:	e8 73 ff ff ff       	call   c0101694 <pic_setmask>
}
c0101721:	90                   	nop
c0101722:	89 ec                	mov    %ebp,%esp
c0101724:	5d                   	pop    %ebp
c0101725:	c3                   	ret    

c0101726 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c0101726:	55                   	push   %ebp
c0101727:	89 e5                	mov    %esp,%ebp
c0101729:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
c010172c:	c7 05 6c c6 11 c0 01 	movl   $0x1,0xc011c66c
c0101733:	00 00 00 
c0101736:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
c010173c:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101740:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c0101744:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c0101748:	ee                   	out    %al,(%dx)
}
c0101749:	90                   	nop
c010174a:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
c0101750:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101754:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c0101758:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c010175c:	ee                   	out    %al,(%dx)
}
c010175d:	90                   	nop
c010175e:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c0101764:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101768:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c010176c:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0101770:	ee                   	out    %al,(%dx)
}
c0101771:	90                   	nop
c0101772:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
c0101778:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010177c:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101780:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101784:	ee                   	out    %al,(%dx)
}
c0101785:	90                   	nop
c0101786:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
c010178c:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101790:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0101794:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101798:	ee                   	out    %al,(%dx)
}
c0101799:	90                   	nop
c010179a:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
c01017a0:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017a4:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01017a8:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01017ac:	ee                   	out    %al,(%dx)
}
c01017ad:	90                   	nop
c01017ae:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
c01017b4:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017b8:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01017bc:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01017c0:	ee                   	out    %al,(%dx)
}
c01017c1:	90                   	nop
c01017c2:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
c01017c8:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017cc:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01017d0:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01017d4:	ee                   	out    %al,(%dx)
}
c01017d5:	90                   	nop
c01017d6:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
c01017dc:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017e0:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01017e4:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01017e8:	ee                   	out    %al,(%dx)
}
c01017e9:	90                   	nop
c01017ea:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
c01017f0:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017f4:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c01017f8:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c01017fc:	ee                   	out    %al,(%dx)
}
c01017fd:	90                   	nop
c01017fe:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
c0101804:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101808:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c010180c:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101810:	ee                   	out    %al,(%dx)
}
c0101811:	90                   	nop
c0101812:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c0101818:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010181c:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101820:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0101824:	ee                   	out    %al,(%dx)
}
c0101825:	90                   	nop
c0101826:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
c010182c:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101830:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101834:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0101838:	ee                   	out    %al,(%dx)
}
c0101839:	90                   	nop
c010183a:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
c0101840:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101844:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c0101848:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c010184c:	ee                   	out    %al,(%dx)
}
c010184d:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
c010184e:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c0101855:	3d ff ff 00 00       	cmp    $0xffff,%eax
c010185a:	74 0f                	je     c010186b <pic_init+0x145>
        pic_setmask(irq_mask);
c010185c:	0f b7 05 50 95 11 c0 	movzwl 0xc0119550,%eax
c0101863:	89 04 24             	mov    %eax,(%esp)
c0101866:	e8 29 fe ff ff       	call   c0101694 <pic_setmask>
    }
}
c010186b:	90                   	nop
c010186c:	89 ec                	mov    %ebp,%esp
c010186e:	5d                   	pop    %ebp
c010186f:	c3                   	ret    

c0101870 <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
c0101870:	55                   	push   %ebp
c0101871:	89 e5                	mov    %esp,%ebp
c0101873:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
c0101876:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
c010187d:	00 
c010187e:	c7 04 24 20 64 10 c0 	movl   $0xc0106420,(%esp)
c0101885:	e8 dc ea ff ff       	call   c0100366 <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
c010188a:	90                   	nop
c010188b:	89 ec                	mov    %ebp,%esp
c010188d:	5d                   	pop    %ebp
c010188e:	c3                   	ret    

c010188f <idt_init>:
    sizeof(idt) - 1, (uintptr_t)idt
};

/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
c010188f:	55                   	push   %ebp
c0101890:	89 e5                	mov    %esp,%ebp
c0101892:	83 ec 10             	sub    $0x10,%esp
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
    extern uintptr_t __vectors[];//声明了一个外部数组 __vectors，该数组存储中断服务例程（ISR）的地址。
    int i;
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c0101895:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c010189c:	e9 c4 00 00 00       	jmp    c0101965 <idt_init+0xd6>
        SETGATE(idt[i], 0, GD_KTEXT, __vectors[i], DPL_KERNEL);
c01018a1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018a4:	8b 04 85 e0 95 11 c0 	mov    -0x3fee6a20(,%eax,4),%eax
c01018ab:	0f b7 d0             	movzwl %ax,%edx
c01018ae:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018b1:	66 89 14 c5 e0 c6 11 	mov    %dx,-0x3fee3920(,%eax,8)
c01018b8:	c0 
c01018b9:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018bc:	66 c7 04 c5 e2 c6 11 	movw   $0x8,-0x3fee391e(,%eax,8)
c01018c3:	c0 08 00 
c01018c6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018c9:	0f b6 14 c5 e4 c6 11 	movzbl -0x3fee391c(,%eax,8),%edx
c01018d0:	c0 
c01018d1:	80 e2 e0             	and    $0xe0,%dl
c01018d4:	88 14 c5 e4 c6 11 c0 	mov    %dl,-0x3fee391c(,%eax,8)
c01018db:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018de:	0f b6 14 c5 e4 c6 11 	movzbl -0x3fee391c(,%eax,8),%edx
c01018e5:	c0 
c01018e6:	80 e2 1f             	and    $0x1f,%dl
c01018e9:	88 14 c5 e4 c6 11 c0 	mov    %dl,-0x3fee391c(,%eax,8)
c01018f0:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01018f3:	0f b6 14 c5 e5 c6 11 	movzbl -0x3fee391b(,%eax,8),%edx
c01018fa:	c0 
c01018fb:	80 e2 f0             	and    $0xf0,%dl
c01018fe:	80 ca 0e             	or     $0xe,%dl
c0101901:	88 14 c5 e5 c6 11 c0 	mov    %dl,-0x3fee391b(,%eax,8)
c0101908:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010190b:	0f b6 14 c5 e5 c6 11 	movzbl -0x3fee391b(,%eax,8),%edx
c0101912:	c0 
c0101913:	80 e2 ef             	and    $0xef,%dl
c0101916:	88 14 c5 e5 c6 11 c0 	mov    %dl,-0x3fee391b(,%eax,8)
c010191d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101920:	0f b6 14 c5 e5 c6 11 	movzbl -0x3fee391b(,%eax,8),%edx
c0101927:	c0 
c0101928:	80 e2 9f             	and    $0x9f,%dl
c010192b:	88 14 c5 e5 c6 11 c0 	mov    %dl,-0x3fee391b(,%eax,8)
c0101932:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101935:	0f b6 14 c5 e5 c6 11 	movzbl -0x3fee391b(,%eax,8),%edx
c010193c:	c0 
c010193d:	80 ca 80             	or     $0x80,%dl
c0101940:	88 14 c5 e5 c6 11 c0 	mov    %dl,-0x3fee391b(,%eax,8)
c0101947:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010194a:	8b 04 85 e0 95 11 c0 	mov    -0x3fee6a20(,%eax,4),%eax
c0101951:	c1 e8 10             	shr    $0x10,%eax
c0101954:	0f b7 d0             	movzwl %ax,%edx
c0101957:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010195a:	66 89 14 c5 e6 c6 11 	mov    %dx,-0x3fee391a(,%eax,8)
c0101961:	c0 
    for (i = 0; i < sizeof(idt) / sizeof(struct gatedesc); i ++) {
c0101962:	ff 45 fc             	incl   -0x4(%ebp)
c0101965:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101968:	3d ff 00 00 00       	cmp    $0xff,%eax
c010196d:	0f 86 2e ff ff ff    	jbe    c01018a1 <idt_init+0x12>
    //宏用于配置每个 IDT 条目.0 表示最高特权级（内核级）GD_KTEXT: 指向内核代码段的选择子，确保 ISR 在内核代码段中执行。
	//__vectors[i]: 对应中断的 ISR 地址,DPL_KERNEL: 描述符特权级，表示该中断只能由内核级代码触发。
    // set for switch from user to kernel
    //SETGATE 这行代码特别设置了 T_SWITCH_TOK（一个特定的中断向量，用于用户态到内核态的切换）的 IDT 条目。
    //DPL_USER 表示该中断可以由用户态代码触发
    SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
c0101973:	a1 c4 97 11 c0       	mov    0xc01197c4,%eax
c0101978:	0f b7 c0             	movzwl %ax,%eax
c010197b:	66 a3 a8 ca 11 c0    	mov    %ax,0xc011caa8
c0101981:	66 c7 05 aa ca 11 c0 	movw   $0x8,0xc011caaa
c0101988:	08 00 
c010198a:	0f b6 05 ac ca 11 c0 	movzbl 0xc011caac,%eax
c0101991:	24 e0                	and    $0xe0,%al
c0101993:	a2 ac ca 11 c0       	mov    %al,0xc011caac
c0101998:	0f b6 05 ac ca 11 c0 	movzbl 0xc011caac,%eax
c010199f:	24 1f                	and    $0x1f,%al
c01019a1:	a2 ac ca 11 c0       	mov    %al,0xc011caac
c01019a6:	0f b6 05 ad ca 11 c0 	movzbl 0xc011caad,%eax
c01019ad:	24 f0                	and    $0xf0,%al
c01019af:	0c 0e                	or     $0xe,%al
c01019b1:	a2 ad ca 11 c0       	mov    %al,0xc011caad
c01019b6:	0f b6 05 ad ca 11 c0 	movzbl 0xc011caad,%eax
c01019bd:	24 ef                	and    $0xef,%al
c01019bf:	a2 ad ca 11 c0       	mov    %al,0xc011caad
c01019c4:	0f b6 05 ad ca 11 c0 	movzbl 0xc011caad,%eax
c01019cb:	0c 60                	or     $0x60,%al
c01019cd:	a2 ad ca 11 c0       	mov    %al,0xc011caad
c01019d2:	0f b6 05 ad ca 11 c0 	movzbl 0xc011caad,%eax
c01019d9:	0c 80                	or     $0x80,%al
c01019db:	a2 ad ca 11 c0       	mov    %al,0xc011caad
c01019e0:	a1 c4 97 11 c0       	mov    0xc01197c4,%eax
c01019e5:	c1 e8 10             	shr    $0x10,%eax
c01019e8:	0f b7 c0             	movzwl %ax,%eax
c01019eb:	66 a3 ae ca 11 c0    	mov    %ax,0xc011caae
c01019f1:	c7 45 f8 60 95 11 c0 	movl   $0xc0119560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
c01019f8:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01019fb:	0f 01 18             	lidtl  (%eax)
}
c01019fe:	90                   	nop
	// load the IDT
    //使用 lidt 指令将 IDT 描述符加载到 CPU 中
    lidt(&idt_pd);
}
c01019ff:	90                   	nop
c0101a00:	89 ec                	mov    %ebp,%esp
c0101a02:	5d                   	pop    %ebp
c0101a03:	c3                   	ret    

c0101a04 <trapname>:

static const char *
trapname(int trapno) {
c0101a04:	55                   	push   %ebp
c0101a05:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c0101a07:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a0a:	83 f8 13             	cmp    $0x13,%eax
c0101a0d:	77 0c                	ja     c0101a1b <trapname+0x17>
        return excnames[trapno];
c0101a0f:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a12:	8b 04 85 80 67 10 c0 	mov    -0x3fef9880(,%eax,4),%eax
c0101a19:	eb 18                	jmp    c0101a33 <trapname+0x2f>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c0101a1b:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c0101a1f:	7e 0d                	jle    c0101a2e <trapname+0x2a>
c0101a21:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c0101a25:	7f 07                	jg     c0101a2e <trapname+0x2a>
        return "Hardware Interrupt";
c0101a27:	b8 2a 64 10 c0       	mov    $0xc010642a,%eax
c0101a2c:	eb 05                	jmp    c0101a33 <trapname+0x2f>
    }
    return "(unknown trap)";
c0101a2e:	b8 3d 64 10 c0       	mov    $0xc010643d,%eax
}
c0101a33:	5d                   	pop    %ebp
c0101a34:	c3                   	ret    

c0101a35 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
c0101a35:	55                   	push   %ebp
c0101a36:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
c0101a38:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a3b:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101a3f:	83 f8 08             	cmp    $0x8,%eax
c0101a42:	0f 94 c0             	sete   %al
c0101a45:	0f b6 c0             	movzbl %al,%eax
}
c0101a48:	5d                   	pop    %ebp
c0101a49:	c3                   	ret    

c0101a4a <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c0101a4a:	55                   	push   %ebp
c0101a4b:	89 e5                	mov    %esp,%ebp
c0101a4d:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
c0101a50:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a53:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101a57:	c7 04 24 7e 64 10 c0 	movl   $0xc010647e,(%esp)
c0101a5e:	e8 03 e9 ff ff       	call   c0100366 <cprintf>
    print_regs(&tf->tf_regs);
c0101a63:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a66:	89 04 24             	mov    %eax,(%esp)
c0101a69:	e8 8f 01 00 00       	call   c0101bfd <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
c0101a6e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a71:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c0101a75:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101a79:	c7 04 24 8f 64 10 c0 	movl   $0xc010648f,(%esp)
c0101a80:	e8 e1 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
c0101a85:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a88:	0f b7 40 28          	movzwl 0x28(%eax),%eax
c0101a8c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101a90:	c7 04 24 a2 64 10 c0 	movl   $0xc01064a2,(%esp)
c0101a97:	e8 ca e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
c0101a9c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101a9f:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c0101aa3:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101aa7:	c7 04 24 b5 64 10 c0 	movl   $0xc01064b5,(%esp)
c0101aae:	e8 b3 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
c0101ab3:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ab6:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c0101aba:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101abe:	c7 04 24 c8 64 10 c0 	movl   $0xc01064c8,(%esp)
c0101ac5:	e8 9c e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c0101aca:	8b 45 08             	mov    0x8(%ebp),%eax
c0101acd:	8b 40 30             	mov    0x30(%eax),%eax
c0101ad0:	89 04 24             	mov    %eax,(%esp)
c0101ad3:	e8 2c ff ff ff       	call   c0101a04 <trapname>
c0101ad8:	8b 55 08             	mov    0x8(%ebp),%edx
c0101adb:	8b 52 30             	mov    0x30(%edx),%edx
c0101ade:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101ae2:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101ae6:	c7 04 24 db 64 10 c0 	movl   $0xc01064db,(%esp)
c0101aed:	e8 74 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
c0101af2:	8b 45 08             	mov    0x8(%ebp),%eax
c0101af5:	8b 40 34             	mov    0x34(%eax),%eax
c0101af8:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101afc:	c7 04 24 ed 64 10 c0 	movl   $0xc01064ed,(%esp)
c0101b03:	e8 5e e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
c0101b08:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b0b:	8b 40 38             	mov    0x38(%eax),%eax
c0101b0e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b12:	c7 04 24 fc 64 10 c0 	movl   $0xc01064fc,(%esp)
c0101b19:	e8 48 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
c0101b1e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b21:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101b25:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b29:	c7 04 24 0b 65 10 c0 	movl   $0xc010650b,(%esp)
c0101b30:	e8 31 e8 ff ff       	call   c0100366 <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
c0101b35:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b38:	8b 40 40             	mov    0x40(%eax),%eax
c0101b3b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b3f:	c7 04 24 1e 65 10 c0 	movl   $0xc010651e,(%esp)
c0101b46:	e8 1b e8 ff ff       	call   c0100366 <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101b4b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0101b52:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c0101b59:	eb 3d                	jmp    c0101b98 <print_trapframe+0x14e>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c0101b5b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101b5e:	8b 50 40             	mov    0x40(%eax),%edx
c0101b61:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101b64:	21 d0                	and    %edx,%eax
c0101b66:	85 c0                	test   %eax,%eax
c0101b68:	74 28                	je     c0101b92 <print_trapframe+0x148>
c0101b6a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101b6d:	8b 04 85 80 95 11 c0 	mov    -0x3fee6a80(,%eax,4),%eax
c0101b74:	85 c0                	test   %eax,%eax
c0101b76:	74 1a                	je     c0101b92 <print_trapframe+0x148>
            cprintf("%s,", IA32flags[i]);
c0101b78:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101b7b:	8b 04 85 80 95 11 c0 	mov    -0x3fee6a80(,%eax,4),%eax
c0101b82:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101b86:	c7 04 24 2d 65 10 c0 	movl   $0xc010652d,(%esp)
c0101b8d:	e8 d4 e7 ff ff       	call   c0100366 <cprintf>
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101b92:	ff 45 f4             	incl   -0xc(%ebp)
c0101b95:	d1 65 f0             	shll   -0x10(%ebp)
c0101b98:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101b9b:	83 f8 17             	cmp    $0x17,%eax
c0101b9e:	76 bb                	jbe    c0101b5b <print_trapframe+0x111>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c0101ba0:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ba3:	8b 40 40             	mov    0x40(%eax),%eax
c0101ba6:	c1 e8 0c             	shr    $0xc,%eax
c0101ba9:	83 e0 03             	and    $0x3,%eax
c0101bac:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bb0:	c7 04 24 31 65 10 c0 	movl   $0xc0106531,(%esp)
c0101bb7:	e8 aa e7 ff ff       	call   c0100366 <cprintf>

    if (!trap_in_kernel(tf)) {
c0101bbc:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bbf:	89 04 24             	mov    %eax,(%esp)
c0101bc2:	e8 6e fe ff ff       	call   c0101a35 <trap_in_kernel>
c0101bc7:	85 c0                	test   %eax,%eax
c0101bc9:	75 2d                	jne    c0101bf8 <print_trapframe+0x1ae>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
c0101bcb:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bce:	8b 40 44             	mov    0x44(%eax),%eax
c0101bd1:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bd5:	c7 04 24 3a 65 10 c0 	movl   $0xc010653a,(%esp)
c0101bdc:	e8 85 e7 ff ff       	call   c0100366 <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
c0101be1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101be4:	0f b7 40 48          	movzwl 0x48(%eax),%eax
c0101be8:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101bec:	c7 04 24 49 65 10 c0 	movl   $0xc0106549,(%esp)
c0101bf3:	e8 6e e7 ff ff       	call   c0100366 <cprintf>
    }
}
c0101bf8:	90                   	nop
c0101bf9:	89 ec                	mov    %ebp,%esp
c0101bfb:	5d                   	pop    %ebp
c0101bfc:	c3                   	ret    

c0101bfd <print_regs>:

void
print_regs(struct pushregs *regs) {
c0101bfd:	55                   	push   %ebp
c0101bfe:	89 e5                	mov    %esp,%ebp
c0101c00:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
c0101c03:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c06:	8b 00                	mov    (%eax),%eax
c0101c08:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c0c:	c7 04 24 5c 65 10 c0 	movl   $0xc010655c,(%esp)
c0101c13:	e8 4e e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
c0101c18:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c1b:	8b 40 04             	mov    0x4(%eax),%eax
c0101c1e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c22:	c7 04 24 6b 65 10 c0 	movl   $0xc010656b,(%esp)
c0101c29:	e8 38 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c0101c2e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c31:	8b 40 08             	mov    0x8(%eax),%eax
c0101c34:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c38:	c7 04 24 7a 65 10 c0 	movl   $0xc010657a,(%esp)
c0101c3f:	e8 22 e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c0101c44:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c47:	8b 40 0c             	mov    0xc(%eax),%eax
c0101c4a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c4e:	c7 04 24 89 65 10 c0 	movl   $0xc0106589,(%esp)
c0101c55:	e8 0c e7 ff ff       	call   c0100366 <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c0101c5a:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c5d:	8b 40 10             	mov    0x10(%eax),%eax
c0101c60:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c64:	c7 04 24 98 65 10 c0 	movl   $0xc0106598,(%esp)
c0101c6b:	e8 f6 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
c0101c70:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c73:	8b 40 14             	mov    0x14(%eax),%eax
c0101c76:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c7a:	c7 04 24 a7 65 10 c0 	movl   $0xc01065a7,(%esp)
c0101c81:	e8 e0 e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c0101c86:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c89:	8b 40 18             	mov    0x18(%eax),%eax
c0101c8c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c90:	c7 04 24 b6 65 10 c0 	movl   $0xc01065b6,(%esp)
c0101c97:	e8 ca e6 ff ff       	call   c0100366 <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
c0101c9c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c9f:	8b 40 1c             	mov    0x1c(%eax),%eax
c0101ca2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101ca6:	c7 04 24 c5 65 10 c0 	movl   $0xc01065c5,(%esp)
c0101cad:	e8 b4 e6 ff ff       	call   c0100366 <cprintf>
}
c0101cb2:	90                   	nop
c0101cb3:	89 ec                	mov    %ebp,%esp
c0101cb5:	5d                   	pop    %ebp
c0101cb6:	c3                   	ret    

c0101cb7 <trap_dispatch>:

struct trapframe switchk2u, *switchu2k;
/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
c0101cb7:	55                   	push   %ebp
c0101cb8:	89 e5                	mov    %esp,%ebp
c0101cba:	83 ec 28             	sub    $0x28,%esp
c0101cbd:	89 5d fc             	mov    %ebx,-0x4(%ebp)
    char c;

    switch (tf->tf_trapno) {
c0101cc0:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cc3:	8b 40 30             	mov    0x30(%eax),%eax
c0101cc6:	83 f8 79             	cmp    $0x79,%eax
c0101cc9:	0f 84 6c 01 00 00    	je     c0101e3b <trap_dispatch+0x184>
c0101ccf:	83 f8 79             	cmp    $0x79,%eax
c0101cd2:	0f 87 e0 01 00 00    	ja     c0101eb8 <trap_dispatch+0x201>
c0101cd8:	83 f8 78             	cmp    $0x78,%eax
c0101cdb:	0f 84 d0 00 00 00    	je     c0101db1 <trap_dispatch+0xfa>
c0101ce1:	83 f8 78             	cmp    $0x78,%eax
c0101ce4:	0f 87 ce 01 00 00    	ja     c0101eb8 <trap_dispatch+0x201>
c0101cea:	83 f8 2f             	cmp    $0x2f,%eax
c0101ced:	0f 87 c5 01 00 00    	ja     c0101eb8 <trap_dispatch+0x201>
c0101cf3:	83 f8 2e             	cmp    $0x2e,%eax
c0101cf6:	0f 83 f1 01 00 00    	jae    c0101eed <trap_dispatch+0x236>
c0101cfc:	83 f8 24             	cmp    $0x24,%eax
c0101cff:	74 5e                	je     c0101d5f <trap_dispatch+0xa8>
c0101d01:	83 f8 24             	cmp    $0x24,%eax
c0101d04:	0f 87 ae 01 00 00    	ja     c0101eb8 <trap_dispatch+0x201>
c0101d0a:	83 f8 20             	cmp    $0x20,%eax
c0101d0d:	74 0a                	je     c0101d19 <trap_dispatch+0x62>
c0101d0f:	83 f8 21             	cmp    $0x21,%eax
c0101d12:	74 74                	je     c0101d88 <trap_dispatch+0xd1>
c0101d14:	e9 9f 01 00 00       	jmp    c0101eb8 <trap_dispatch+0x201>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        ticks ++; //记录中断事件
c0101d19:	a1 24 c4 11 c0       	mov    0xc011c424,%eax
c0101d1e:	40                   	inc    %eax
c0101d1f:	a3 24 c4 11 c0       	mov    %eax,0xc011c424
        if (ticks % TICK_NUM == 0)
c0101d24:	8b 0d 24 c4 11 c0    	mov    0xc011c424,%ecx
c0101d2a:	ba 1f 85 eb 51       	mov    $0x51eb851f,%edx
c0101d2f:	89 c8                	mov    %ecx,%eax
c0101d31:	f7 e2                	mul    %edx
c0101d33:	c1 ea 05             	shr    $0x5,%edx
c0101d36:	89 d0                	mov    %edx,%eax
c0101d38:	c1 e0 02             	shl    $0x2,%eax
c0101d3b:	01 d0                	add    %edx,%eax
c0101d3d:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0101d44:	01 d0                	add    %edx,%eax
c0101d46:	c1 e0 02             	shl    $0x2,%eax
c0101d49:	29 c1                	sub    %eax,%ecx
c0101d4b:	89 ca                	mov    %ecx,%edx
c0101d4d:	85 d2                	test   %edx,%edx
c0101d4f:	0f 85 9b 01 00 00    	jne    c0101ef0 <trap_dispatch+0x239>
        {
            print_ticks();
c0101d55:	e8 16 fb ff ff       	call   c0101870 <print_ticks>
        }//每经过 TICK_NUM 次周期时，调用 print_ticks() 打印信息。
        break;
c0101d5a:	e9 91 01 00 00       	jmp    c0101ef0 <trap_dispatch+0x239>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
c0101d5f:	e8 af f8 ff ff       	call   c0101613 <cons_getc>
c0101d64:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial [%03d] %c\n", c, c);
c0101d67:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0101d6b:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101d6f:	89 54 24 08          	mov    %edx,0x8(%esp)
c0101d73:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d77:	c7 04 24 d4 65 10 c0 	movl   $0xc01065d4,(%esp)
c0101d7e:	e8 e3 e5 ff ff       	call   c0100366 <cprintf>
        break;
c0101d83:	e9 6f 01 00 00       	jmp    c0101ef7 <trap_dispatch+0x240>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
c0101d88:	e8 86 f8 ff ff       	call   c0101613 <cons_getc>
c0101d8d:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
c0101d90:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0101d94:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101d98:	89 54 24 08          	mov    %edx,0x8(%esp)
c0101d9c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101da0:	c7 04 24 e6 65 10 c0 	movl   $0xc01065e6,(%esp)
c0101da7:	e8 ba e5 ff ff       	call   c0100366 <cprintf>
        break;
c0101dac:	e9 46 01 00 00       	jmp    c0101ef7 <trap_dispatch+0x240>
    //LAB1 CHALLENGE 1 : YOUR CODE you should modify below codes.
    case T_SWITCH_TOU://表示发生了从内核模式切换到用户模式的请求。
        if (tf->tf_cs != USER_CS) {//判断当前是否在内核模式下
c0101db1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101db4:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101db8:	83 f8 1b             	cmp    $0x1b,%eax
c0101dbb:	0f 84 32 01 00 00    	je     c0101ef3 <trap_dispatch+0x23c>
            switchk2u = *tf; //保存当前陷阱框架
c0101dc1:	8b 4d 08             	mov    0x8(%ebp),%ecx
c0101dc4:	b8 4c 00 00 00       	mov    $0x4c,%eax
c0101dc9:	83 e0 fc             	and    $0xfffffffc,%eax
c0101dcc:	89 c3                	mov    %eax,%ebx
c0101dce:	b8 00 00 00 00       	mov    $0x0,%eax
c0101dd3:	8b 14 01             	mov    (%ecx,%eax,1),%edx
c0101dd6:	89 90 80 c6 11 c0    	mov    %edx,-0x3fee3980(%eax)
c0101ddc:	83 c0 04             	add    $0x4,%eax
c0101ddf:	39 d8                	cmp    %ebx,%eax
c0101de1:	72 f0                	jb     c0101dd3 <trap_dispatch+0x11c>
            switchk2u.tf_cs = USER_CS;//设置用户模式的段寄存器
c0101de3:	66 c7 05 bc c6 11 c0 	movw   $0x1b,0xc011c6bc
c0101dea:	1b 00 
            //将数据段和栈段寄存器 都设置为 USER_DS（用户数据段）
            switchk2u.tf_ds = switchk2u.tf_es = switchk2u.tf_ss = USER_DS;
c0101dec:	66 c7 05 c8 c6 11 c0 	movw   $0x23,0xc011c6c8
c0101df3:	23 00 
c0101df5:	0f b7 05 c8 c6 11 c0 	movzwl 0xc011c6c8,%eax
c0101dfc:	66 a3 a8 c6 11 c0    	mov    %ax,0xc011c6a8
c0101e02:	0f b7 05 a8 c6 11 c0 	movzwl 0xc011c6a8,%eax
c0101e09:	66 a3 ac c6 11 c0    	mov    %ax,0xc011c6ac
            switchk2u.tf_esp = (uint32_t)tf + sizeof(struct trapframe) - 8;
c0101e0f:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e12:	83 c0 44             	add    $0x44,%eax
c0101e15:	a3 c4 c6 11 c0       	mov    %eax,0xc011c6c4
        
            // set eflags, make sure ucore can use io under user mode.
            // if CPL > IOPL, then cpu will generate a general protection.
            switchk2u.tf_eflags |= FL_IOPL_MASK;//允许用户模式下进行 I/O 操作
c0101e1a:	a1 c0 c6 11 c0       	mov    0xc011c6c0,%eax
c0101e1f:	0d 00 30 00 00       	or     $0x3000,%eax
c0101e24:	a3 c0 c6 11 c0       	mov    %eax,0xc011c6c0
        
            // set temporary stack
            // then iret will jump to the right stack
            *((uint32_t *)tf - 1) = (uint32_t)&switchk2u;
c0101e29:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e2c:	83 e8 04             	sub    $0x4,%eax
c0101e2f:	ba 80 c6 11 c0       	mov    $0xc011c680,%edx
c0101e34:	89 10                	mov    %edx,(%eax)
        }
        break;
c0101e36:	e9 b8 00 00 00       	jmp    c0101ef3 <trap_dispatch+0x23c>
    case T_SWITCH_TOK: // T_SWITCH_TOK 表示发生了从用户模式切换到内核模式的请求。
        if (tf->tf_cs != KERNEL_CS) { //判断当前是否在用户模式下
c0101e3b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e3e:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101e42:	83 f8 08             	cmp    $0x8,%eax
c0101e45:	0f 84 ab 00 00 00    	je     c0101ef6 <trap_dispatch+0x23f>
            tf->tf_cs = KERNEL_CS;
c0101e4b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e4e:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            tf->tf_ds = tf->tf_es = KERNEL_DS;
c0101e54:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e57:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
c0101e5d:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e60:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101e64:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e67:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            //设置内核模式的段寄存器
            tf->tf_eflags &= ~FL_IOPL_MASK; //清除 I/O 权限标志
c0101e6b:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e6e:	8b 40 40             	mov    0x40(%eax),%eax
c0101e71:	25 ff cf ff ff       	and    $0xffffcfff,%eax
c0101e76:	89 c2                	mov    %eax,%edx
c0101e78:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e7b:	89 50 40             	mov    %edx,0x40(%eax)
            switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
c0101e7e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e81:	8b 40 44             	mov    0x44(%eax),%eax
c0101e84:	83 e8 44             	sub    $0x44,%eax
c0101e87:	a3 cc c6 11 c0       	mov    %eax,0xc011c6cc
            //使用 memmove 将当前的陷阱框架（除了最后8个字节）复制到新的陷阱框架位置 switchu2k
            memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
c0101e8c:	a1 cc c6 11 c0       	mov    0xc011c6cc,%eax
c0101e91:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c0101e98:	00 
c0101e99:	8b 55 08             	mov    0x8(%ebp),%edx
c0101e9c:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101ea0:	89 04 24             	mov    %eax,(%esp)
c0101ea3:	e8 e8 40 00 00       	call   c0105f90 <memmove>
            //将新的陷阱框架地址 switchu2k 存储到当前陷阱框架之前的一个栈位置
            *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
c0101ea8:	8b 15 cc c6 11 c0    	mov    0xc011c6cc,%edx
c0101eae:	8b 45 08             	mov    0x8(%ebp),%eax
c0101eb1:	83 e8 04             	sub    $0x4,%eax
c0101eb4:	89 10                	mov    %edx,(%eax)
        }
        break;
c0101eb6:	eb 3e                	jmp    c0101ef6 <trap_dispatch+0x23f>
    case IRQ_OFFSET + IRQ_IDE2:
        /* do nothing */
        break;
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
c0101eb8:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ebb:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101ebf:	83 e0 03             	and    $0x3,%eax
c0101ec2:	85 c0                	test   %eax,%eax
c0101ec4:	75 31                	jne    c0101ef7 <trap_dispatch+0x240>
            print_trapframe(tf);
c0101ec6:	8b 45 08             	mov    0x8(%ebp),%eax
c0101ec9:	89 04 24             	mov    %eax,(%esp)
c0101ecc:	e8 79 fb ff ff       	call   c0101a4a <print_trapframe>
            panic("unexpected trap in kernel.\n");
c0101ed1:	c7 44 24 08 f5 65 10 	movl   $0xc01065f5,0x8(%esp)
c0101ed8:	c0 
c0101ed9:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
c0101ee0:	00 
c0101ee1:	c7 04 24 11 66 10 c0 	movl   $0xc0106611,(%esp)
c0101ee8:	e8 46 ed ff ff       	call   c0100c33 <__panic>
        break;
c0101eed:	90                   	nop
c0101eee:	eb 07                	jmp    c0101ef7 <trap_dispatch+0x240>
        break;
c0101ef0:	90                   	nop
c0101ef1:	eb 04                	jmp    c0101ef7 <trap_dispatch+0x240>
        break;
c0101ef3:	90                   	nop
c0101ef4:	eb 01                	jmp    c0101ef7 <trap_dispatch+0x240>
        break;
c0101ef6:	90                   	nop
        }
    }
}
c0101ef7:	90                   	nop
c0101ef8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
c0101efb:	89 ec                	mov    %ebp,%esp
c0101efd:	5d                   	pop    %ebp
c0101efe:	c3                   	ret    

c0101eff <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
c0101eff:	55                   	push   %ebp
c0101f00:	89 e5                	mov    %esp,%ebp
c0101f02:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
c0101f05:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f08:	89 04 24             	mov    %eax,(%esp)
c0101f0b:	e8 a7 fd ff ff       	call   c0101cb7 <trap_dispatch>
}
c0101f10:	90                   	nop
c0101f11:	89 ec                	mov    %ebp,%esp
c0101f13:	5d                   	pop    %ebp
c0101f14:	c3                   	ret    

c0101f15 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
c0101f15:	1e                   	push   %ds
    pushl %es
c0101f16:	06                   	push   %es
    pushl %fs
c0101f17:	0f a0                	push   %fs
    pushl %gs
c0101f19:	0f a8                	push   %gs
    pushal
c0101f1b:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
c0101f1c:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c0101f21:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c0101f23:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
c0101f25:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
c0101f26:	e8 d4 ff ff ff       	call   c0101eff <trap>

    # pop the pushed stack pointer
    popl %esp
c0101f2b:	5c                   	pop    %esp

c0101f2c <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
c0101f2c:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
c0101f2d:	0f a9                	pop    %gs
    popl %fs
c0101f2f:	0f a1                	pop    %fs
    popl %es
c0101f31:	07                   	pop    %es
    popl %ds
c0101f32:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
c0101f33:	83 c4 08             	add    $0x8,%esp
    iret
c0101f36:	cf                   	iret   

c0101f37 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c0101f37:	6a 00                	push   $0x0
  pushl $0
c0101f39:	6a 00                	push   $0x0
  jmp __alltraps
c0101f3b:	e9 d5 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f40 <vector1>:
.globl vector1
vector1:
  pushl $0
c0101f40:	6a 00                	push   $0x0
  pushl $1
c0101f42:	6a 01                	push   $0x1
  jmp __alltraps
c0101f44:	e9 cc ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f49 <vector2>:
.globl vector2
vector2:
  pushl $0
c0101f49:	6a 00                	push   $0x0
  pushl $2
c0101f4b:	6a 02                	push   $0x2
  jmp __alltraps
c0101f4d:	e9 c3 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f52 <vector3>:
.globl vector3
vector3:
  pushl $0
c0101f52:	6a 00                	push   $0x0
  pushl $3
c0101f54:	6a 03                	push   $0x3
  jmp __alltraps
c0101f56:	e9 ba ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f5b <vector4>:
.globl vector4
vector4:
  pushl $0
c0101f5b:	6a 00                	push   $0x0
  pushl $4
c0101f5d:	6a 04                	push   $0x4
  jmp __alltraps
c0101f5f:	e9 b1 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f64 <vector5>:
.globl vector5
vector5:
  pushl $0
c0101f64:	6a 00                	push   $0x0
  pushl $5
c0101f66:	6a 05                	push   $0x5
  jmp __alltraps
c0101f68:	e9 a8 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f6d <vector6>:
.globl vector6
vector6:
  pushl $0
c0101f6d:	6a 00                	push   $0x0
  pushl $6
c0101f6f:	6a 06                	push   $0x6
  jmp __alltraps
c0101f71:	e9 9f ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f76 <vector7>:
.globl vector7
vector7:
  pushl $0
c0101f76:	6a 00                	push   $0x0
  pushl $7
c0101f78:	6a 07                	push   $0x7
  jmp __alltraps
c0101f7a:	e9 96 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f7f <vector8>:
.globl vector8
vector8:
  pushl $8
c0101f7f:	6a 08                	push   $0x8
  jmp __alltraps
c0101f81:	e9 8f ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f86 <vector9>:
.globl vector9
vector9:
  pushl $0
c0101f86:	6a 00                	push   $0x0
  pushl $9
c0101f88:	6a 09                	push   $0x9
  jmp __alltraps
c0101f8a:	e9 86 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f8f <vector10>:
.globl vector10
vector10:
  pushl $10
c0101f8f:	6a 0a                	push   $0xa
  jmp __alltraps
c0101f91:	e9 7f ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f96 <vector11>:
.globl vector11
vector11:
  pushl $11
c0101f96:	6a 0b                	push   $0xb
  jmp __alltraps
c0101f98:	e9 78 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101f9d <vector12>:
.globl vector12
vector12:
  pushl $12
c0101f9d:	6a 0c                	push   $0xc
  jmp __alltraps
c0101f9f:	e9 71 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fa4 <vector13>:
.globl vector13
vector13:
  pushl $13
c0101fa4:	6a 0d                	push   $0xd
  jmp __alltraps
c0101fa6:	e9 6a ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fab <vector14>:
.globl vector14
vector14:
  pushl $14
c0101fab:	6a 0e                	push   $0xe
  jmp __alltraps
c0101fad:	e9 63 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fb2 <vector15>:
.globl vector15
vector15:
  pushl $0
c0101fb2:	6a 00                	push   $0x0
  pushl $15
c0101fb4:	6a 0f                	push   $0xf
  jmp __alltraps
c0101fb6:	e9 5a ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fbb <vector16>:
.globl vector16
vector16:
  pushl $0
c0101fbb:	6a 00                	push   $0x0
  pushl $16
c0101fbd:	6a 10                	push   $0x10
  jmp __alltraps
c0101fbf:	e9 51 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fc4 <vector17>:
.globl vector17
vector17:
  pushl $17
c0101fc4:	6a 11                	push   $0x11
  jmp __alltraps
c0101fc6:	e9 4a ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fcb <vector18>:
.globl vector18
vector18:
  pushl $0
c0101fcb:	6a 00                	push   $0x0
  pushl $18
c0101fcd:	6a 12                	push   $0x12
  jmp __alltraps
c0101fcf:	e9 41 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fd4 <vector19>:
.globl vector19
vector19:
  pushl $0
c0101fd4:	6a 00                	push   $0x0
  pushl $19
c0101fd6:	6a 13                	push   $0x13
  jmp __alltraps
c0101fd8:	e9 38 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fdd <vector20>:
.globl vector20
vector20:
  pushl $0
c0101fdd:	6a 00                	push   $0x0
  pushl $20
c0101fdf:	6a 14                	push   $0x14
  jmp __alltraps
c0101fe1:	e9 2f ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fe6 <vector21>:
.globl vector21
vector21:
  pushl $0
c0101fe6:	6a 00                	push   $0x0
  pushl $21
c0101fe8:	6a 15                	push   $0x15
  jmp __alltraps
c0101fea:	e9 26 ff ff ff       	jmp    c0101f15 <__alltraps>

c0101fef <vector22>:
.globl vector22
vector22:
  pushl $0
c0101fef:	6a 00                	push   $0x0
  pushl $22
c0101ff1:	6a 16                	push   $0x16
  jmp __alltraps
c0101ff3:	e9 1d ff ff ff       	jmp    c0101f15 <__alltraps>

c0101ff8 <vector23>:
.globl vector23
vector23:
  pushl $0
c0101ff8:	6a 00                	push   $0x0
  pushl $23
c0101ffa:	6a 17                	push   $0x17
  jmp __alltraps
c0101ffc:	e9 14 ff ff ff       	jmp    c0101f15 <__alltraps>

c0102001 <vector24>:
.globl vector24
vector24:
  pushl $0
c0102001:	6a 00                	push   $0x0
  pushl $24
c0102003:	6a 18                	push   $0x18
  jmp __alltraps
c0102005:	e9 0b ff ff ff       	jmp    c0101f15 <__alltraps>

c010200a <vector25>:
.globl vector25
vector25:
  pushl $0
c010200a:	6a 00                	push   $0x0
  pushl $25
c010200c:	6a 19                	push   $0x19
  jmp __alltraps
c010200e:	e9 02 ff ff ff       	jmp    c0101f15 <__alltraps>

c0102013 <vector26>:
.globl vector26
vector26:
  pushl $0
c0102013:	6a 00                	push   $0x0
  pushl $26
c0102015:	6a 1a                	push   $0x1a
  jmp __alltraps
c0102017:	e9 f9 fe ff ff       	jmp    c0101f15 <__alltraps>

c010201c <vector27>:
.globl vector27
vector27:
  pushl $0
c010201c:	6a 00                	push   $0x0
  pushl $27
c010201e:	6a 1b                	push   $0x1b
  jmp __alltraps
c0102020:	e9 f0 fe ff ff       	jmp    c0101f15 <__alltraps>

c0102025 <vector28>:
.globl vector28
vector28:
  pushl $0
c0102025:	6a 00                	push   $0x0
  pushl $28
c0102027:	6a 1c                	push   $0x1c
  jmp __alltraps
c0102029:	e9 e7 fe ff ff       	jmp    c0101f15 <__alltraps>

c010202e <vector29>:
.globl vector29
vector29:
  pushl $0
c010202e:	6a 00                	push   $0x0
  pushl $29
c0102030:	6a 1d                	push   $0x1d
  jmp __alltraps
c0102032:	e9 de fe ff ff       	jmp    c0101f15 <__alltraps>

c0102037 <vector30>:
.globl vector30
vector30:
  pushl $0
c0102037:	6a 00                	push   $0x0
  pushl $30
c0102039:	6a 1e                	push   $0x1e
  jmp __alltraps
c010203b:	e9 d5 fe ff ff       	jmp    c0101f15 <__alltraps>

c0102040 <vector31>:
.globl vector31
vector31:
  pushl $0
c0102040:	6a 00                	push   $0x0
  pushl $31
c0102042:	6a 1f                	push   $0x1f
  jmp __alltraps
c0102044:	e9 cc fe ff ff       	jmp    c0101f15 <__alltraps>

c0102049 <vector32>:
.globl vector32
vector32:
  pushl $0
c0102049:	6a 00                	push   $0x0
  pushl $32
c010204b:	6a 20                	push   $0x20
  jmp __alltraps
c010204d:	e9 c3 fe ff ff       	jmp    c0101f15 <__alltraps>

c0102052 <vector33>:
.globl vector33
vector33:
  pushl $0
c0102052:	6a 00                	push   $0x0
  pushl $33
c0102054:	6a 21                	push   $0x21
  jmp __alltraps
c0102056:	e9 ba fe ff ff       	jmp    c0101f15 <__alltraps>

c010205b <vector34>:
.globl vector34
vector34:
  pushl $0
c010205b:	6a 00                	push   $0x0
  pushl $34
c010205d:	6a 22                	push   $0x22
  jmp __alltraps
c010205f:	e9 b1 fe ff ff       	jmp    c0101f15 <__alltraps>

c0102064 <vector35>:
.globl vector35
vector35:
  pushl $0
c0102064:	6a 00                	push   $0x0
  pushl $35
c0102066:	6a 23                	push   $0x23
  jmp __alltraps
c0102068:	e9 a8 fe ff ff       	jmp    c0101f15 <__alltraps>

c010206d <vector36>:
.globl vector36
vector36:
  pushl $0
c010206d:	6a 00                	push   $0x0
  pushl $36
c010206f:	6a 24                	push   $0x24
  jmp __alltraps
c0102071:	e9 9f fe ff ff       	jmp    c0101f15 <__alltraps>

c0102076 <vector37>:
.globl vector37
vector37:
  pushl $0
c0102076:	6a 00                	push   $0x0
  pushl $37
c0102078:	6a 25                	push   $0x25
  jmp __alltraps
c010207a:	e9 96 fe ff ff       	jmp    c0101f15 <__alltraps>

c010207f <vector38>:
.globl vector38
vector38:
  pushl $0
c010207f:	6a 00                	push   $0x0
  pushl $38
c0102081:	6a 26                	push   $0x26
  jmp __alltraps
c0102083:	e9 8d fe ff ff       	jmp    c0101f15 <__alltraps>

c0102088 <vector39>:
.globl vector39
vector39:
  pushl $0
c0102088:	6a 00                	push   $0x0
  pushl $39
c010208a:	6a 27                	push   $0x27
  jmp __alltraps
c010208c:	e9 84 fe ff ff       	jmp    c0101f15 <__alltraps>

c0102091 <vector40>:
.globl vector40
vector40:
  pushl $0
c0102091:	6a 00                	push   $0x0
  pushl $40
c0102093:	6a 28                	push   $0x28
  jmp __alltraps
c0102095:	e9 7b fe ff ff       	jmp    c0101f15 <__alltraps>

c010209a <vector41>:
.globl vector41
vector41:
  pushl $0
c010209a:	6a 00                	push   $0x0
  pushl $41
c010209c:	6a 29                	push   $0x29
  jmp __alltraps
c010209e:	e9 72 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020a3 <vector42>:
.globl vector42
vector42:
  pushl $0
c01020a3:	6a 00                	push   $0x0
  pushl $42
c01020a5:	6a 2a                	push   $0x2a
  jmp __alltraps
c01020a7:	e9 69 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020ac <vector43>:
.globl vector43
vector43:
  pushl $0
c01020ac:	6a 00                	push   $0x0
  pushl $43
c01020ae:	6a 2b                	push   $0x2b
  jmp __alltraps
c01020b0:	e9 60 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020b5 <vector44>:
.globl vector44
vector44:
  pushl $0
c01020b5:	6a 00                	push   $0x0
  pushl $44
c01020b7:	6a 2c                	push   $0x2c
  jmp __alltraps
c01020b9:	e9 57 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020be <vector45>:
.globl vector45
vector45:
  pushl $0
c01020be:	6a 00                	push   $0x0
  pushl $45
c01020c0:	6a 2d                	push   $0x2d
  jmp __alltraps
c01020c2:	e9 4e fe ff ff       	jmp    c0101f15 <__alltraps>

c01020c7 <vector46>:
.globl vector46
vector46:
  pushl $0
c01020c7:	6a 00                	push   $0x0
  pushl $46
c01020c9:	6a 2e                	push   $0x2e
  jmp __alltraps
c01020cb:	e9 45 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020d0 <vector47>:
.globl vector47
vector47:
  pushl $0
c01020d0:	6a 00                	push   $0x0
  pushl $47
c01020d2:	6a 2f                	push   $0x2f
  jmp __alltraps
c01020d4:	e9 3c fe ff ff       	jmp    c0101f15 <__alltraps>

c01020d9 <vector48>:
.globl vector48
vector48:
  pushl $0
c01020d9:	6a 00                	push   $0x0
  pushl $48
c01020db:	6a 30                	push   $0x30
  jmp __alltraps
c01020dd:	e9 33 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020e2 <vector49>:
.globl vector49
vector49:
  pushl $0
c01020e2:	6a 00                	push   $0x0
  pushl $49
c01020e4:	6a 31                	push   $0x31
  jmp __alltraps
c01020e6:	e9 2a fe ff ff       	jmp    c0101f15 <__alltraps>

c01020eb <vector50>:
.globl vector50
vector50:
  pushl $0
c01020eb:	6a 00                	push   $0x0
  pushl $50
c01020ed:	6a 32                	push   $0x32
  jmp __alltraps
c01020ef:	e9 21 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020f4 <vector51>:
.globl vector51
vector51:
  pushl $0
c01020f4:	6a 00                	push   $0x0
  pushl $51
c01020f6:	6a 33                	push   $0x33
  jmp __alltraps
c01020f8:	e9 18 fe ff ff       	jmp    c0101f15 <__alltraps>

c01020fd <vector52>:
.globl vector52
vector52:
  pushl $0
c01020fd:	6a 00                	push   $0x0
  pushl $52
c01020ff:	6a 34                	push   $0x34
  jmp __alltraps
c0102101:	e9 0f fe ff ff       	jmp    c0101f15 <__alltraps>

c0102106 <vector53>:
.globl vector53
vector53:
  pushl $0
c0102106:	6a 00                	push   $0x0
  pushl $53
c0102108:	6a 35                	push   $0x35
  jmp __alltraps
c010210a:	e9 06 fe ff ff       	jmp    c0101f15 <__alltraps>

c010210f <vector54>:
.globl vector54
vector54:
  pushl $0
c010210f:	6a 00                	push   $0x0
  pushl $54
c0102111:	6a 36                	push   $0x36
  jmp __alltraps
c0102113:	e9 fd fd ff ff       	jmp    c0101f15 <__alltraps>

c0102118 <vector55>:
.globl vector55
vector55:
  pushl $0
c0102118:	6a 00                	push   $0x0
  pushl $55
c010211a:	6a 37                	push   $0x37
  jmp __alltraps
c010211c:	e9 f4 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102121 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102121:	6a 00                	push   $0x0
  pushl $56
c0102123:	6a 38                	push   $0x38
  jmp __alltraps
c0102125:	e9 eb fd ff ff       	jmp    c0101f15 <__alltraps>

c010212a <vector57>:
.globl vector57
vector57:
  pushl $0
c010212a:	6a 00                	push   $0x0
  pushl $57
c010212c:	6a 39                	push   $0x39
  jmp __alltraps
c010212e:	e9 e2 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102133 <vector58>:
.globl vector58
vector58:
  pushl $0
c0102133:	6a 00                	push   $0x0
  pushl $58
c0102135:	6a 3a                	push   $0x3a
  jmp __alltraps
c0102137:	e9 d9 fd ff ff       	jmp    c0101f15 <__alltraps>

c010213c <vector59>:
.globl vector59
vector59:
  pushl $0
c010213c:	6a 00                	push   $0x0
  pushl $59
c010213e:	6a 3b                	push   $0x3b
  jmp __alltraps
c0102140:	e9 d0 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102145 <vector60>:
.globl vector60
vector60:
  pushl $0
c0102145:	6a 00                	push   $0x0
  pushl $60
c0102147:	6a 3c                	push   $0x3c
  jmp __alltraps
c0102149:	e9 c7 fd ff ff       	jmp    c0101f15 <__alltraps>

c010214e <vector61>:
.globl vector61
vector61:
  pushl $0
c010214e:	6a 00                	push   $0x0
  pushl $61
c0102150:	6a 3d                	push   $0x3d
  jmp __alltraps
c0102152:	e9 be fd ff ff       	jmp    c0101f15 <__alltraps>

c0102157 <vector62>:
.globl vector62
vector62:
  pushl $0
c0102157:	6a 00                	push   $0x0
  pushl $62
c0102159:	6a 3e                	push   $0x3e
  jmp __alltraps
c010215b:	e9 b5 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102160 <vector63>:
.globl vector63
vector63:
  pushl $0
c0102160:	6a 00                	push   $0x0
  pushl $63
c0102162:	6a 3f                	push   $0x3f
  jmp __alltraps
c0102164:	e9 ac fd ff ff       	jmp    c0101f15 <__alltraps>

c0102169 <vector64>:
.globl vector64
vector64:
  pushl $0
c0102169:	6a 00                	push   $0x0
  pushl $64
c010216b:	6a 40                	push   $0x40
  jmp __alltraps
c010216d:	e9 a3 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102172 <vector65>:
.globl vector65
vector65:
  pushl $0
c0102172:	6a 00                	push   $0x0
  pushl $65
c0102174:	6a 41                	push   $0x41
  jmp __alltraps
c0102176:	e9 9a fd ff ff       	jmp    c0101f15 <__alltraps>

c010217b <vector66>:
.globl vector66
vector66:
  pushl $0
c010217b:	6a 00                	push   $0x0
  pushl $66
c010217d:	6a 42                	push   $0x42
  jmp __alltraps
c010217f:	e9 91 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102184 <vector67>:
.globl vector67
vector67:
  pushl $0
c0102184:	6a 00                	push   $0x0
  pushl $67
c0102186:	6a 43                	push   $0x43
  jmp __alltraps
c0102188:	e9 88 fd ff ff       	jmp    c0101f15 <__alltraps>

c010218d <vector68>:
.globl vector68
vector68:
  pushl $0
c010218d:	6a 00                	push   $0x0
  pushl $68
c010218f:	6a 44                	push   $0x44
  jmp __alltraps
c0102191:	e9 7f fd ff ff       	jmp    c0101f15 <__alltraps>

c0102196 <vector69>:
.globl vector69
vector69:
  pushl $0
c0102196:	6a 00                	push   $0x0
  pushl $69
c0102198:	6a 45                	push   $0x45
  jmp __alltraps
c010219a:	e9 76 fd ff ff       	jmp    c0101f15 <__alltraps>

c010219f <vector70>:
.globl vector70
vector70:
  pushl $0
c010219f:	6a 00                	push   $0x0
  pushl $70
c01021a1:	6a 46                	push   $0x46
  jmp __alltraps
c01021a3:	e9 6d fd ff ff       	jmp    c0101f15 <__alltraps>

c01021a8 <vector71>:
.globl vector71
vector71:
  pushl $0
c01021a8:	6a 00                	push   $0x0
  pushl $71
c01021aa:	6a 47                	push   $0x47
  jmp __alltraps
c01021ac:	e9 64 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021b1 <vector72>:
.globl vector72
vector72:
  pushl $0
c01021b1:	6a 00                	push   $0x0
  pushl $72
c01021b3:	6a 48                	push   $0x48
  jmp __alltraps
c01021b5:	e9 5b fd ff ff       	jmp    c0101f15 <__alltraps>

c01021ba <vector73>:
.globl vector73
vector73:
  pushl $0
c01021ba:	6a 00                	push   $0x0
  pushl $73
c01021bc:	6a 49                	push   $0x49
  jmp __alltraps
c01021be:	e9 52 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021c3 <vector74>:
.globl vector74
vector74:
  pushl $0
c01021c3:	6a 00                	push   $0x0
  pushl $74
c01021c5:	6a 4a                	push   $0x4a
  jmp __alltraps
c01021c7:	e9 49 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021cc <vector75>:
.globl vector75
vector75:
  pushl $0
c01021cc:	6a 00                	push   $0x0
  pushl $75
c01021ce:	6a 4b                	push   $0x4b
  jmp __alltraps
c01021d0:	e9 40 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021d5 <vector76>:
.globl vector76
vector76:
  pushl $0
c01021d5:	6a 00                	push   $0x0
  pushl $76
c01021d7:	6a 4c                	push   $0x4c
  jmp __alltraps
c01021d9:	e9 37 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021de <vector77>:
.globl vector77
vector77:
  pushl $0
c01021de:	6a 00                	push   $0x0
  pushl $77
c01021e0:	6a 4d                	push   $0x4d
  jmp __alltraps
c01021e2:	e9 2e fd ff ff       	jmp    c0101f15 <__alltraps>

c01021e7 <vector78>:
.globl vector78
vector78:
  pushl $0
c01021e7:	6a 00                	push   $0x0
  pushl $78
c01021e9:	6a 4e                	push   $0x4e
  jmp __alltraps
c01021eb:	e9 25 fd ff ff       	jmp    c0101f15 <__alltraps>

c01021f0 <vector79>:
.globl vector79
vector79:
  pushl $0
c01021f0:	6a 00                	push   $0x0
  pushl $79
c01021f2:	6a 4f                	push   $0x4f
  jmp __alltraps
c01021f4:	e9 1c fd ff ff       	jmp    c0101f15 <__alltraps>

c01021f9 <vector80>:
.globl vector80
vector80:
  pushl $0
c01021f9:	6a 00                	push   $0x0
  pushl $80
c01021fb:	6a 50                	push   $0x50
  jmp __alltraps
c01021fd:	e9 13 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102202 <vector81>:
.globl vector81
vector81:
  pushl $0
c0102202:	6a 00                	push   $0x0
  pushl $81
c0102204:	6a 51                	push   $0x51
  jmp __alltraps
c0102206:	e9 0a fd ff ff       	jmp    c0101f15 <__alltraps>

c010220b <vector82>:
.globl vector82
vector82:
  pushl $0
c010220b:	6a 00                	push   $0x0
  pushl $82
c010220d:	6a 52                	push   $0x52
  jmp __alltraps
c010220f:	e9 01 fd ff ff       	jmp    c0101f15 <__alltraps>

c0102214 <vector83>:
.globl vector83
vector83:
  pushl $0
c0102214:	6a 00                	push   $0x0
  pushl $83
c0102216:	6a 53                	push   $0x53
  jmp __alltraps
c0102218:	e9 f8 fc ff ff       	jmp    c0101f15 <__alltraps>

c010221d <vector84>:
.globl vector84
vector84:
  pushl $0
c010221d:	6a 00                	push   $0x0
  pushl $84
c010221f:	6a 54                	push   $0x54
  jmp __alltraps
c0102221:	e9 ef fc ff ff       	jmp    c0101f15 <__alltraps>

c0102226 <vector85>:
.globl vector85
vector85:
  pushl $0
c0102226:	6a 00                	push   $0x0
  pushl $85
c0102228:	6a 55                	push   $0x55
  jmp __alltraps
c010222a:	e9 e6 fc ff ff       	jmp    c0101f15 <__alltraps>

c010222f <vector86>:
.globl vector86
vector86:
  pushl $0
c010222f:	6a 00                	push   $0x0
  pushl $86
c0102231:	6a 56                	push   $0x56
  jmp __alltraps
c0102233:	e9 dd fc ff ff       	jmp    c0101f15 <__alltraps>

c0102238 <vector87>:
.globl vector87
vector87:
  pushl $0
c0102238:	6a 00                	push   $0x0
  pushl $87
c010223a:	6a 57                	push   $0x57
  jmp __alltraps
c010223c:	e9 d4 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102241 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102241:	6a 00                	push   $0x0
  pushl $88
c0102243:	6a 58                	push   $0x58
  jmp __alltraps
c0102245:	e9 cb fc ff ff       	jmp    c0101f15 <__alltraps>

c010224a <vector89>:
.globl vector89
vector89:
  pushl $0
c010224a:	6a 00                	push   $0x0
  pushl $89
c010224c:	6a 59                	push   $0x59
  jmp __alltraps
c010224e:	e9 c2 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102253 <vector90>:
.globl vector90
vector90:
  pushl $0
c0102253:	6a 00                	push   $0x0
  pushl $90
c0102255:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102257:	e9 b9 fc ff ff       	jmp    c0101f15 <__alltraps>

c010225c <vector91>:
.globl vector91
vector91:
  pushl $0
c010225c:	6a 00                	push   $0x0
  pushl $91
c010225e:	6a 5b                	push   $0x5b
  jmp __alltraps
c0102260:	e9 b0 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102265 <vector92>:
.globl vector92
vector92:
  pushl $0
c0102265:	6a 00                	push   $0x0
  pushl $92
c0102267:	6a 5c                	push   $0x5c
  jmp __alltraps
c0102269:	e9 a7 fc ff ff       	jmp    c0101f15 <__alltraps>

c010226e <vector93>:
.globl vector93
vector93:
  pushl $0
c010226e:	6a 00                	push   $0x0
  pushl $93
c0102270:	6a 5d                	push   $0x5d
  jmp __alltraps
c0102272:	e9 9e fc ff ff       	jmp    c0101f15 <__alltraps>

c0102277 <vector94>:
.globl vector94
vector94:
  pushl $0
c0102277:	6a 00                	push   $0x0
  pushl $94
c0102279:	6a 5e                	push   $0x5e
  jmp __alltraps
c010227b:	e9 95 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102280 <vector95>:
.globl vector95
vector95:
  pushl $0
c0102280:	6a 00                	push   $0x0
  pushl $95
c0102282:	6a 5f                	push   $0x5f
  jmp __alltraps
c0102284:	e9 8c fc ff ff       	jmp    c0101f15 <__alltraps>

c0102289 <vector96>:
.globl vector96
vector96:
  pushl $0
c0102289:	6a 00                	push   $0x0
  pushl $96
c010228b:	6a 60                	push   $0x60
  jmp __alltraps
c010228d:	e9 83 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102292 <vector97>:
.globl vector97
vector97:
  pushl $0
c0102292:	6a 00                	push   $0x0
  pushl $97
c0102294:	6a 61                	push   $0x61
  jmp __alltraps
c0102296:	e9 7a fc ff ff       	jmp    c0101f15 <__alltraps>

c010229b <vector98>:
.globl vector98
vector98:
  pushl $0
c010229b:	6a 00                	push   $0x0
  pushl $98
c010229d:	6a 62                	push   $0x62
  jmp __alltraps
c010229f:	e9 71 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022a4 <vector99>:
.globl vector99
vector99:
  pushl $0
c01022a4:	6a 00                	push   $0x0
  pushl $99
c01022a6:	6a 63                	push   $0x63
  jmp __alltraps
c01022a8:	e9 68 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022ad <vector100>:
.globl vector100
vector100:
  pushl $0
c01022ad:	6a 00                	push   $0x0
  pushl $100
c01022af:	6a 64                	push   $0x64
  jmp __alltraps
c01022b1:	e9 5f fc ff ff       	jmp    c0101f15 <__alltraps>

c01022b6 <vector101>:
.globl vector101
vector101:
  pushl $0
c01022b6:	6a 00                	push   $0x0
  pushl $101
c01022b8:	6a 65                	push   $0x65
  jmp __alltraps
c01022ba:	e9 56 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022bf <vector102>:
.globl vector102
vector102:
  pushl $0
c01022bf:	6a 00                	push   $0x0
  pushl $102
c01022c1:	6a 66                	push   $0x66
  jmp __alltraps
c01022c3:	e9 4d fc ff ff       	jmp    c0101f15 <__alltraps>

c01022c8 <vector103>:
.globl vector103
vector103:
  pushl $0
c01022c8:	6a 00                	push   $0x0
  pushl $103
c01022ca:	6a 67                	push   $0x67
  jmp __alltraps
c01022cc:	e9 44 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022d1 <vector104>:
.globl vector104
vector104:
  pushl $0
c01022d1:	6a 00                	push   $0x0
  pushl $104
c01022d3:	6a 68                	push   $0x68
  jmp __alltraps
c01022d5:	e9 3b fc ff ff       	jmp    c0101f15 <__alltraps>

c01022da <vector105>:
.globl vector105
vector105:
  pushl $0
c01022da:	6a 00                	push   $0x0
  pushl $105
c01022dc:	6a 69                	push   $0x69
  jmp __alltraps
c01022de:	e9 32 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022e3 <vector106>:
.globl vector106
vector106:
  pushl $0
c01022e3:	6a 00                	push   $0x0
  pushl $106
c01022e5:	6a 6a                	push   $0x6a
  jmp __alltraps
c01022e7:	e9 29 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022ec <vector107>:
.globl vector107
vector107:
  pushl $0
c01022ec:	6a 00                	push   $0x0
  pushl $107
c01022ee:	6a 6b                	push   $0x6b
  jmp __alltraps
c01022f0:	e9 20 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022f5 <vector108>:
.globl vector108
vector108:
  pushl $0
c01022f5:	6a 00                	push   $0x0
  pushl $108
c01022f7:	6a 6c                	push   $0x6c
  jmp __alltraps
c01022f9:	e9 17 fc ff ff       	jmp    c0101f15 <__alltraps>

c01022fe <vector109>:
.globl vector109
vector109:
  pushl $0
c01022fe:	6a 00                	push   $0x0
  pushl $109
c0102300:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102302:	e9 0e fc ff ff       	jmp    c0101f15 <__alltraps>

c0102307 <vector110>:
.globl vector110
vector110:
  pushl $0
c0102307:	6a 00                	push   $0x0
  pushl $110
c0102309:	6a 6e                	push   $0x6e
  jmp __alltraps
c010230b:	e9 05 fc ff ff       	jmp    c0101f15 <__alltraps>

c0102310 <vector111>:
.globl vector111
vector111:
  pushl $0
c0102310:	6a 00                	push   $0x0
  pushl $111
c0102312:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102314:	e9 fc fb ff ff       	jmp    c0101f15 <__alltraps>

c0102319 <vector112>:
.globl vector112
vector112:
  pushl $0
c0102319:	6a 00                	push   $0x0
  pushl $112
c010231b:	6a 70                	push   $0x70
  jmp __alltraps
c010231d:	e9 f3 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102322 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102322:	6a 00                	push   $0x0
  pushl $113
c0102324:	6a 71                	push   $0x71
  jmp __alltraps
c0102326:	e9 ea fb ff ff       	jmp    c0101f15 <__alltraps>

c010232b <vector114>:
.globl vector114
vector114:
  pushl $0
c010232b:	6a 00                	push   $0x0
  pushl $114
c010232d:	6a 72                	push   $0x72
  jmp __alltraps
c010232f:	e9 e1 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102334 <vector115>:
.globl vector115
vector115:
  pushl $0
c0102334:	6a 00                	push   $0x0
  pushl $115
c0102336:	6a 73                	push   $0x73
  jmp __alltraps
c0102338:	e9 d8 fb ff ff       	jmp    c0101f15 <__alltraps>

c010233d <vector116>:
.globl vector116
vector116:
  pushl $0
c010233d:	6a 00                	push   $0x0
  pushl $116
c010233f:	6a 74                	push   $0x74
  jmp __alltraps
c0102341:	e9 cf fb ff ff       	jmp    c0101f15 <__alltraps>

c0102346 <vector117>:
.globl vector117
vector117:
  pushl $0
c0102346:	6a 00                	push   $0x0
  pushl $117
c0102348:	6a 75                	push   $0x75
  jmp __alltraps
c010234a:	e9 c6 fb ff ff       	jmp    c0101f15 <__alltraps>

c010234f <vector118>:
.globl vector118
vector118:
  pushl $0
c010234f:	6a 00                	push   $0x0
  pushl $118
c0102351:	6a 76                	push   $0x76
  jmp __alltraps
c0102353:	e9 bd fb ff ff       	jmp    c0101f15 <__alltraps>

c0102358 <vector119>:
.globl vector119
vector119:
  pushl $0
c0102358:	6a 00                	push   $0x0
  pushl $119
c010235a:	6a 77                	push   $0x77
  jmp __alltraps
c010235c:	e9 b4 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102361 <vector120>:
.globl vector120
vector120:
  pushl $0
c0102361:	6a 00                	push   $0x0
  pushl $120
c0102363:	6a 78                	push   $0x78
  jmp __alltraps
c0102365:	e9 ab fb ff ff       	jmp    c0101f15 <__alltraps>

c010236a <vector121>:
.globl vector121
vector121:
  pushl $0
c010236a:	6a 00                	push   $0x0
  pushl $121
c010236c:	6a 79                	push   $0x79
  jmp __alltraps
c010236e:	e9 a2 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102373 <vector122>:
.globl vector122
vector122:
  pushl $0
c0102373:	6a 00                	push   $0x0
  pushl $122
c0102375:	6a 7a                	push   $0x7a
  jmp __alltraps
c0102377:	e9 99 fb ff ff       	jmp    c0101f15 <__alltraps>

c010237c <vector123>:
.globl vector123
vector123:
  pushl $0
c010237c:	6a 00                	push   $0x0
  pushl $123
c010237e:	6a 7b                	push   $0x7b
  jmp __alltraps
c0102380:	e9 90 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102385 <vector124>:
.globl vector124
vector124:
  pushl $0
c0102385:	6a 00                	push   $0x0
  pushl $124
c0102387:	6a 7c                	push   $0x7c
  jmp __alltraps
c0102389:	e9 87 fb ff ff       	jmp    c0101f15 <__alltraps>

c010238e <vector125>:
.globl vector125
vector125:
  pushl $0
c010238e:	6a 00                	push   $0x0
  pushl $125
c0102390:	6a 7d                	push   $0x7d
  jmp __alltraps
c0102392:	e9 7e fb ff ff       	jmp    c0101f15 <__alltraps>

c0102397 <vector126>:
.globl vector126
vector126:
  pushl $0
c0102397:	6a 00                	push   $0x0
  pushl $126
c0102399:	6a 7e                	push   $0x7e
  jmp __alltraps
c010239b:	e9 75 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023a0 <vector127>:
.globl vector127
vector127:
  pushl $0
c01023a0:	6a 00                	push   $0x0
  pushl $127
c01023a2:	6a 7f                	push   $0x7f
  jmp __alltraps
c01023a4:	e9 6c fb ff ff       	jmp    c0101f15 <__alltraps>

c01023a9 <vector128>:
.globl vector128
vector128:
  pushl $0
c01023a9:	6a 00                	push   $0x0
  pushl $128
c01023ab:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c01023b0:	e9 60 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023b5 <vector129>:
.globl vector129
vector129:
  pushl $0
c01023b5:	6a 00                	push   $0x0
  pushl $129
c01023b7:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c01023bc:	e9 54 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023c1 <vector130>:
.globl vector130
vector130:
  pushl $0
c01023c1:	6a 00                	push   $0x0
  pushl $130
c01023c3:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c01023c8:	e9 48 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023cd <vector131>:
.globl vector131
vector131:
  pushl $0
c01023cd:	6a 00                	push   $0x0
  pushl $131
c01023cf:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c01023d4:	e9 3c fb ff ff       	jmp    c0101f15 <__alltraps>

c01023d9 <vector132>:
.globl vector132
vector132:
  pushl $0
c01023d9:	6a 00                	push   $0x0
  pushl $132
c01023db:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c01023e0:	e9 30 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023e5 <vector133>:
.globl vector133
vector133:
  pushl $0
c01023e5:	6a 00                	push   $0x0
  pushl $133
c01023e7:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c01023ec:	e9 24 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023f1 <vector134>:
.globl vector134
vector134:
  pushl $0
c01023f1:	6a 00                	push   $0x0
  pushl $134
c01023f3:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c01023f8:	e9 18 fb ff ff       	jmp    c0101f15 <__alltraps>

c01023fd <vector135>:
.globl vector135
vector135:
  pushl $0
c01023fd:	6a 00                	push   $0x0
  pushl $135
c01023ff:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102404:	e9 0c fb ff ff       	jmp    c0101f15 <__alltraps>

c0102409 <vector136>:
.globl vector136
vector136:
  pushl $0
c0102409:	6a 00                	push   $0x0
  pushl $136
c010240b:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c0102410:	e9 00 fb ff ff       	jmp    c0101f15 <__alltraps>

c0102415 <vector137>:
.globl vector137
vector137:
  pushl $0
c0102415:	6a 00                	push   $0x0
  pushl $137
c0102417:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c010241c:	e9 f4 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102421 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102421:	6a 00                	push   $0x0
  pushl $138
c0102423:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c0102428:	e9 e8 fa ff ff       	jmp    c0101f15 <__alltraps>

c010242d <vector139>:
.globl vector139
vector139:
  pushl $0
c010242d:	6a 00                	push   $0x0
  pushl $139
c010242f:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102434:	e9 dc fa ff ff       	jmp    c0101f15 <__alltraps>

c0102439 <vector140>:
.globl vector140
vector140:
  pushl $0
c0102439:	6a 00                	push   $0x0
  pushl $140
c010243b:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c0102440:	e9 d0 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102445 <vector141>:
.globl vector141
vector141:
  pushl $0
c0102445:	6a 00                	push   $0x0
  pushl $141
c0102447:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c010244c:	e9 c4 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102451 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102451:	6a 00                	push   $0x0
  pushl $142
c0102453:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c0102458:	e9 b8 fa ff ff       	jmp    c0101f15 <__alltraps>

c010245d <vector143>:
.globl vector143
vector143:
  pushl $0
c010245d:	6a 00                	push   $0x0
  pushl $143
c010245f:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c0102464:	e9 ac fa ff ff       	jmp    c0101f15 <__alltraps>

c0102469 <vector144>:
.globl vector144
vector144:
  pushl $0
c0102469:	6a 00                	push   $0x0
  pushl $144
c010246b:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c0102470:	e9 a0 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102475 <vector145>:
.globl vector145
vector145:
  pushl $0
c0102475:	6a 00                	push   $0x0
  pushl $145
c0102477:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c010247c:	e9 94 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102481 <vector146>:
.globl vector146
vector146:
  pushl $0
c0102481:	6a 00                	push   $0x0
  pushl $146
c0102483:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c0102488:	e9 88 fa ff ff       	jmp    c0101f15 <__alltraps>

c010248d <vector147>:
.globl vector147
vector147:
  pushl $0
c010248d:	6a 00                	push   $0x0
  pushl $147
c010248f:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c0102494:	e9 7c fa ff ff       	jmp    c0101f15 <__alltraps>

c0102499 <vector148>:
.globl vector148
vector148:
  pushl $0
c0102499:	6a 00                	push   $0x0
  pushl $148
c010249b:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c01024a0:	e9 70 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024a5 <vector149>:
.globl vector149
vector149:
  pushl $0
c01024a5:	6a 00                	push   $0x0
  pushl $149
c01024a7:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c01024ac:	e9 64 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024b1 <vector150>:
.globl vector150
vector150:
  pushl $0
c01024b1:	6a 00                	push   $0x0
  pushl $150
c01024b3:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c01024b8:	e9 58 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024bd <vector151>:
.globl vector151
vector151:
  pushl $0
c01024bd:	6a 00                	push   $0x0
  pushl $151
c01024bf:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c01024c4:	e9 4c fa ff ff       	jmp    c0101f15 <__alltraps>

c01024c9 <vector152>:
.globl vector152
vector152:
  pushl $0
c01024c9:	6a 00                	push   $0x0
  pushl $152
c01024cb:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c01024d0:	e9 40 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024d5 <vector153>:
.globl vector153
vector153:
  pushl $0
c01024d5:	6a 00                	push   $0x0
  pushl $153
c01024d7:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c01024dc:	e9 34 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024e1 <vector154>:
.globl vector154
vector154:
  pushl $0
c01024e1:	6a 00                	push   $0x0
  pushl $154
c01024e3:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c01024e8:	e9 28 fa ff ff       	jmp    c0101f15 <__alltraps>

c01024ed <vector155>:
.globl vector155
vector155:
  pushl $0
c01024ed:	6a 00                	push   $0x0
  pushl $155
c01024ef:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c01024f4:	e9 1c fa ff ff       	jmp    c0101f15 <__alltraps>

c01024f9 <vector156>:
.globl vector156
vector156:
  pushl $0
c01024f9:	6a 00                	push   $0x0
  pushl $156
c01024fb:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c0102500:	e9 10 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102505 <vector157>:
.globl vector157
vector157:
  pushl $0
c0102505:	6a 00                	push   $0x0
  pushl $157
c0102507:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c010250c:	e9 04 fa ff ff       	jmp    c0101f15 <__alltraps>

c0102511 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102511:	6a 00                	push   $0x0
  pushl $158
c0102513:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c0102518:	e9 f8 f9 ff ff       	jmp    c0101f15 <__alltraps>

c010251d <vector159>:
.globl vector159
vector159:
  pushl $0
c010251d:	6a 00                	push   $0x0
  pushl $159
c010251f:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102524:	e9 ec f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102529 <vector160>:
.globl vector160
vector160:
  pushl $0
c0102529:	6a 00                	push   $0x0
  pushl $160
c010252b:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c0102530:	e9 e0 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102535 <vector161>:
.globl vector161
vector161:
  pushl $0
c0102535:	6a 00                	push   $0x0
  pushl $161
c0102537:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c010253c:	e9 d4 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102541 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102541:	6a 00                	push   $0x0
  pushl $162
c0102543:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c0102548:	e9 c8 f9 ff ff       	jmp    c0101f15 <__alltraps>

c010254d <vector163>:
.globl vector163
vector163:
  pushl $0
c010254d:	6a 00                	push   $0x0
  pushl $163
c010254f:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102554:	e9 bc f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102559 <vector164>:
.globl vector164
vector164:
  pushl $0
c0102559:	6a 00                	push   $0x0
  pushl $164
c010255b:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c0102560:	e9 b0 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102565 <vector165>:
.globl vector165
vector165:
  pushl $0
c0102565:	6a 00                	push   $0x0
  pushl $165
c0102567:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c010256c:	e9 a4 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102571 <vector166>:
.globl vector166
vector166:
  pushl $0
c0102571:	6a 00                	push   $0x0
  pushl $166
c0102573:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c0102578:	e9 98 f9 ff ff       	jmp    c0101f15 <__alltraps>

c010257d <vector167>:
.globl vector167
vector167:
  pushl $0
c010257d:	6a 00                	push   $0x0
  pushl $167
c010257f:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c0102584:	e9 8c f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102589 <vector168>:
.globl vector168
vector168:
  pushl $0
c0102589:	6a 00                	push   $0x0
  pushl $168
c010258b:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c0102590:	e9 80 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102595 <vector169>:
.globl vector169
vector169:
  pushl $0
c0102595:	6a 00                	push   $0x0
  pushl $169
c0102597:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c010259c:	e9 74 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025a1 <vector170>:
.globl vector170
vector170:
  pushl $0
c01025a1:	6a 00                	push   $0x0
  pushl $170
c01025a3:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c01025a8:	e9 68 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025ad <vector171>:
.globl vector171
vector171:
  pushl $0
c01025ad:	6a 00                	push   $0x0
  pushl $171
c01025af:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c01025b4:	e9 5c f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025b9 <vector172>:
.globl vector172
vector172:
  pushl $0
c01025b9:	6a 00                	push   $0x0
  pushl $172
c01025bb:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c01025c0:	e9 50 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025c5 <vector173>:
.globl vector173
vector173:
  pushl $0
c01025c5:	6a 00                	push   $0x0
  pushl $173
c01025c7:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c01025cc:	e9 44 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025d1 <vector174>:
.globl vector174
vector174:
  pushl $0
c01025d1:	6a 00                	push   $0x0
  pushl $174
c01025d3:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c01025d8:	e9 38 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025dd <vector175>:
.globl vector175
vector175:
  pushl $0
c01025dd:	6a 00                	push   $0x0
  pushl $175
c01025df:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c01025e4:	e9 2c f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025e9 <vector176>:
.globl vector176
vector176:
  pushl $0
c01025e9:	6a 00                	push   $0x0
  pushl $176
c01025eb:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c01025f0:	e9 20 f9 ff ff       	jmp    c0101f15 <__alltraps>

c01025f5 <vector177>:
.globl vector177
vector177:
  pushl $0
c01025f5:	6a 00                	push   $0x0
  pushl $177
c01025f7:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c01025fc:	e9 14 f9 ff ff       	jmp    c0101f15 <__alltraps>

c0102601 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102601:	6a 00                	push   $0x0
  pushl $178
c0102603:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c0102608:	e9 08 f9 ff ff       	jmp    c0101f15 <__alltraps>

c010260d <vector179>:
.globl vector179
vector179:
  pushl $0
c010260d:	6a 00                	push   $0x0
  pushl $179
c010260f:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102614:	e9 fc f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102619 <vector180>:
.globl vector180
vector180:
  pushl $0
c0102619:	6a 00                	push   $0x0
  pushl $180
c010261b:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c0102620:	e9 f0 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102625 <vector181>:
.globl vector181
vector181:
  pushl $0
c0102625:	6a 00                	push   $0x0
  pushl $181
c0102627:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c010262c:	e9 e4 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102631 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102631:	6a 00                	push   $0x0
  pushl $182
c0102633:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c0102638:	e9 d8 f8 ff ff       	jmp    c0101f15 <__alltraps>

c010263d <vector183>:
.globl vector183
vector183:
  pushl $0
c010263d:	6a 00                	push   $0x0
  pushl $183
c010263f:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102644:	e9 cc f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102649 <vector184>:
.globl vector184
vector184:
  pushl $0
c0102649:	6a 00                	push   $0x0
  pushl $184
c010264b:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c0102650:	e9 c0 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102655 <vector185>:
.globl vector185
vector185:
  pushl $0
c0102655:	6a 00                	push   $0x0
  pushl $185
c0102657:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c010265c:	e9 b4 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102661 <vector186>:
.globl vector186
vector186:
  pushl $0
c0102661:	6a 00                	push   $0x0
  pushl $186
c0102663:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c0102668:	e9 a8 f8 ff ff       	jmp    c0101f15 <__alltraps>

c010266d <vector187>:
.globl vector187
vector187:
  pushl $0
c010266d:	6a 00                	push   $0x0
  pushl $187
c010266f:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c0102674:	e9 9c f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102679 <vector188>:
.globl vector188
vector188:
  pushl $0
c0102679:	6a 00                	push   $0x0
  pushl $188
c010267b:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c0102680:	e9 90 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102685 <vector189>:
.globl vector189
vector189:
  pushl $0
c0102685:	6a 00                	push   $0x0
  pushl $189
c0102687:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c010268c:	e9 84 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102691 <vector190>:
.globl vector190
vector190:
  pushl $0
c0102691:	6a 00                	push   $0x0
  pushl $190
c0102693:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c0102698:	e9 78 f8 ff ff       	jmp    c0101f15 <__alltraps>

c010269d <vector191>:
.globl vector191
vector191:
  pushl $0
c010269d:	6a 00                	push   $0x0
  pushl $191
c010269f:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c01026a4:	e9 6c f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026a9 <vector192>:
.globl vector192
vector192:
  pushl $0
c01026a9:	6a 00                	push   $0x0
  pushl $192
c01026ab:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c01026b0:	e9 60 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026b5 <vector193>:
.globl vector193
vector193:
  pushl $0
c01026b5:	6a 00                	push   $0x0
  pushl $193
c01026b7:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c01026bc:	e9 54 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026c1 <vector194>:
.globl vector194
vector194:
  pushl $0
c01026c1:	6a 00                	push   $0x0
  pushl $194
c01026c3:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c01026c8:	e9 48 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026cd <vector195>:
.globl vector195
vector195:
  pushl $0
c01026cd:	6a 00                	push   $0x0
  pushl $195
c01026cf:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c01026d4:	e9 3c f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026d9 <vector196>:
.globl vector196
vector196:
  pushl $0
c01026d9:	6a 00                	push   $0x0
  pushl $196
c01026db:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c01026e0:	e9 30 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026e5 <vector197>:
.globl vector197
vector197:
  pushl $0
c01026e5:	6a 00                	push   $0x0
  pushl $197
c01026e7:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c01026ec:	e9 24 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026f1 <vector198>:
.globl vector198
vector198:
  pushl $0
c01026f1:	6a 00                	push   $0x0
  pushl $198
c01026f3:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c01026f8:	e9 18 f8 ff ff       	jmp    c0101f15 <__alltraps>

c01026fd <vector199>:
.globl vector199
vector199:
  pushl $0
c01026fd:	6a 00                	push   $0x0
  pushl $199
c01026ff:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102704:	e9 0c f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102709 <vector200>:
.globl vector200
vector200:
  pushl $0
c0102709:	6a 00                	push   $0x0
  pushl $200
c010270b:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102710:	e9 00 f8 ff ff       	jmp    c0101f15 <__alltraps>

c0102715 <vector201>:
.globl vector201
vector201:
  pushl $0
c0102715:	6a 00                	push   $0x0
  pushl $201
c0102717:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c010271c:	e9 f4 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102721 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102721:	6a 00                	push   $0x0
  pushl $202
c0102723:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c0102728:	e9 e8 f7 ff ff       	jmp    c0101f15 <__alltraps>

c010272d <vector203>:
.globl vector203
vector203:
  pushl $0
c010272d:	6a 00                	push   $0x0
  pushl $203
c010272f:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102734:	e9 dc f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102739 <vector204>:
.globl vector204
vector204:
  pushl $0
c0102739:	6a 00                	push   $0x0
  pushl $204
c010273b:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102740:	e9 d0 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102745 <vector205>:
.globl vector205
vector205:
  pushl $0
c0102745:	6a 00                	push   $0x0
  pushl $205
c0102747:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c010274c:	e9 c4 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102751 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102751:	6a 00                	push   $0x0
  pushl $206
c0102753:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c0102758:	e9 b8 f7 ff ff       	jmp    c0101f15 <__alltraps>

c010275d <vector207>:
.globl vector207
vector207:
  pushl $0
c010275d:	6a 00                	push   $0x0
  pushl $207
c010275f:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c0102764:	e9 ac f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102769 <vector208>:
.globl vector208
vector208:
  pushl $0
c0102769:	6a 00                	push   $0x0
  pushl $208
c010276b:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c0102770:	e9 a0 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102775 <vector209>:
.globl vector209
vector209:
  pushl $0
c0102775:	6a 00                	push   $0x0
  pushl $209
c0102777:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c010277c:	e9 94 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102781 <vector210>:
.globl vector210
vector210:
  pushl $0
c0102781:	6a 00                	push   $0x0
  pushl $210
c0102783:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c0102788:	e9 88 f7 ff ff       	jmp    c0101f15 <__alltraps>

c010278d <vector211>:
.globl vector211
vector211:
  pushl $0
c010278d:	6a 00                	push   $0x0
  pushl $211
c010278f:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c0102794:	e9 7c f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102799 <vector212>:
.globl vector212
vector212:
  pushl $0
c0102799:	6a 00                	push   $0x0
  pushl $212
c010279b:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c01027a0:	e9 70 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027a5 <vector213>:
.globl vector213
vector213:
  pushl $0
c01027a5:	6a 00                	push   $0x0
  pushl $213
c01027a7:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c01027ac:	e9 64 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027b1 <vector214>:
.globl vector214
vector214:
  pushl $0
c01027b1:	6a 00                	push   $0x0
  pushl $214
c01027b3:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c01027b8:	e9 58 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027bd <vector215>:
.globl vector215
vector215:
  pushl $0
c01027bd:	6a 00                	push   $0x0
  pushl $215
c01027bf:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c01027c4:	e9 4c f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027c9 <vector216>:
.globl vector216
vector216:
  pushl $0
c01027c9:	6a 00                	push   $0x0
  pushl $216
c01027cb:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c01027d0:	e9 40 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027d5 <vector217>:
.globl vector217
vector217:
  pushl $0
c01027d5:	6a 00                	push   $0x0
  pushl $217
c01027d7:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c01027dc:	e9 34 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027e1 <vector218>:
.globl vector218
vector218:
  pushl $0
c01027e1:	6a 00                	push   $0x0
  pushl $218
c01027e3:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c01027e8:	e9 28 f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027ed <vector219>:
.globl vector219
vector219:
  pushl $0
c01027ed:	6a 00                	push   $0x0
  pushl $219
c01027ef:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c01027f4:	e9 1c f7 ff ff       	jmp    c0101f15 <__alltraps>

c01027f9 <vector220>:
.globl vector220
vector220:
  pushl $0
c01027f9:	6a 00                	push   $0x0
  pushl $220
c01027fb:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0102800:	e9 10 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102805 <vector221>:
.globl vector221
vector221:
  pushl $0
c0102805:	6a 00                	push   $0x0
  pushl $221
c0102807:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c010280c:	e9 04 f7 ff ff       	jmp    c0101f15 <__alltraps>

c0102811 <vector222>:
.globl vector222
vector222:
  pushl $0
c0102811:	6a 00                	push   $0x0
  pushl $222
c0102813:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c0102818:	e9 f8 f6 ff ff       	jmp    c0101f15 <__alltraps>

c010281d <vector223>:
.globl vector223
vector223:
  pushl $0
c010281d:	6a 00                	push   $0x0
  pushl $223
c010281f:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c0102824:	e9 ec f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102829 <vector224>:
.globl vector224
vector224:
  pushl $0
c0102829:	6a 00                	push   $0x0
  pushl $224
c010282b:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c0102830:	e9 e0 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102835 <vector225>:
.globl vector225
vector225:
  pushl $0
c0102835:	6a 00                	push   $0x0
  pushl $225
c0102837:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c010283c:	e9 d4 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102841 <vector226>:
.globl vector226
vector226:
  pushl $0
c0102841:	6a 00                	push   $0x0
  pushl $226
c0102843:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c0102848:	e9 c8 f6 ff ff       	jmp    c0101f15 <__alltraps>

c010284d <vector227>:
.globl vector227
vector227:
  pushl $0
c010284d:	6a 00                	push   $0x0
  pushl $227
c010284f:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c0102854:	e9 bc f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102859 <vector228>:
.globl vector228
vector228:
  pushl $0
c0102859:	6a 00                	push   $0x0
  pushl $228
c010285b:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c0102860:	e9 b0 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102865 <vector229>:
.globl vector229
vector229:
  pushl $0
c0102865:	6a 00                	push   $0x0
  pushl $229
c0102867:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c010286c:	e9 a4 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102871 <vector230>:
.globl vector230
vector230:
  pushl $0
c0102871:	6a 00                	push   $0x0
  pushl $230
c0102873:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c0102878:	e9 98 f6 ff ff       	jmp    c0101f15 <__alltraps>

c010287d <vector231>:
.globl vector231
vector231:
  pushl $0
c010287d:	6a 00                	push   $0x0
  pushl $231
c010287f:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c0102884:	e9 8c f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102889 <vector232>:
.globl vector232
vector232:
  pushl $0
c0102889:	6a 00                	push   $0x0
  pushl $232
c010288b:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c0102890:	e9 80 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102895 <vector233>:
.globl vector233
vector233:
  pushl $0
c0102895:	6a 00                	push   $0x0
  pushl $233
c0102897:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c010289c:	e9 74 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028a1 <vector234>:
.globl vector234
vector234:
  pushl $0
c01028a1:	6a 00                	push   $0x0
  pushl $234
c01028a3:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c01028a8:	e9 68 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028ad <vector235>:
.globl vector235
vector235:
  pushl $0
c01028ad:	6a 00                	push   $0x0
  pushl $235
c01028af:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c01028b4:	e9 5c f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028b9 <vector236>:
.globl vector236
vector236:
  pushl $0
c01028b9:	6a 00                	push   $0x0
  pushl $236
c01028bb:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c01028c0:	e9 50 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028c5 <vector237>:
.globl vector237
vector237:
  pushl $0
c01028c5:	6a 00                	push   $0x0
  pushl $237
c01028c7:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c01028cc:	e9 44 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028d1 <vector238>:
.globl vector238
vector238:
  pushl $0
c01028d1:	6a 00                	push   $0x0
  pushl $238
c01028d3:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c01028d8:	e9 38 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028dd <vector239>:
.globl vector239
vector239:
  pushl $0
c01028dd:	6a 00                	push   $0x0
  pushl $239
c01028df:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c01028e4:	e9 2c f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028e9 <vector240>:
.globl vector240
vector240:
  pushl $0
c01028e9:	6a 00                	push   $0x0
  pushl $240
c01028eb:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c01028f0:	e9 20 f6 ff ff       	jmp    c0101f15 <__alltraps>

c01028f5 <vector241>:
.globl vector241
vector241:
  pushl $0
c01028f5:	6a 00                	push   $0x0
  pushl $241
c01028f7:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c01028fc:	e9 14 f6 ff ff       	jmp    c0101f15 <__alltraps>

c0102901 <vector242>:
.globl vector242
vector242:
  pushl $0
c0102901:	6a 00                	push   $0x0
  pushl $242
c0102903:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c0102908:	e9 08 f6 ff ff       	jmp    c0101f15 <__alltraps>

c010290d <vector243>:
.globl vector243
vector243:
  pushl $0
c010290d:	6a 00                	push   $0x0
  pushl $243
c010290f:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c0102914:	e9 fc f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102919 <vector244>:
.globl vector244
vector244:
  pushl $0
c0102919:	6a 00                	push   $0x0
  pushl $244
c010291b:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c0102920:	e9 f0 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102925 <vector245>:
.globl vector245
vector245:
  pushl $0
c0102925:	6a 00                	push   $0x0
  pushl $245
c0102927:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c010292c:	e9 e4 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102931 <vector246>:
.globl vector246
vector246:
  pushl $0
c0102931:	6a 00                	push   $0x0
  pushl $246
c0102933:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c0102938:	e9 d8 f5 ff ff       	jmp    c0101f15 <__alltraps>

c010293d <vector247>:
.globl vector247
vector247:
  pushl $0
c010293d:	6a 00                	push   $0x0
  pushl $247
c010293f:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c0102944:	e9 cc f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102949 <vector248>:
.globl vector248
vector248:
  pushl $0
c0102949:	6a 00                	push   $0x0
  pushl $248
c010294b:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c0102950:	e9 c0 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102955 <vector249>:
.globl vector249
vector249:
  pushl $0
c0102955:	6a 00                	push   $0x0
  pushl $249
c0102957:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c010295c:	e9 b4 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102961 <vector250>:
.globl vector250
vector250:
  pushl $0
c0102961:	6a 00                	push   $0x0
  pushl $250
c0102963:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c0102968:	e9 a8 f5 ff ff       	jmp    c0101f15 <__alltraps>

c010296d <vector251>:
.globl vector251
vector251:
  pushl $0
c010296d:	6a 00                	push   $0x0
  pushl $251
c010296f:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c0102974:	e9 9c f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102979 <vector252>:
.globl vector252
vector252:
  pushl $0
c0102979:	6a 00                	push   $0x0
  pushl $252
c010297b:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c0102980:	e9 90 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102985 <vector253>:
.globl vector253
vector253:
  pushl $0
c0102985:	6a 00                	push   $0x0
  pushl $253
c0102987:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c010298c:	e9 84 f5 ff ff       	jmp    c0101f15 <__alltraps>

c0102991 <vector254>:
.globl vector254
vector254:
  pushl $0
c0102991:	6a 00                	push   $0x0
  pushl $254
c0102993:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c0102998:	e9 78 f5 ff ff       	jmp    c0101f15 <__alltraps>

c010299d <vector255>:
.globl vector255
vector255:
  pushl $0
c010299d:	6a 00                	push   $0x0
  pushl $255
c010299f:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c01029a4:	e9 6c f5 ff ff       	jmp    c0101f15 <__alltraps>

c01029a9 <page2ppn>:

extern struct Page *pages;
extern size_t npage;

static inline ppn_t
page2ppn(struct Page *page) {
c01029a9:	55                   	push   %ebp
c01029aa:	89 e5                	mov    %esp,%ebp
    return page - pages;
c01029ac:	8b 15 00 cf 11 c0    	mov    0xc011cf00,%edx
c01029b2:	8b 45 08             	mov    0x8(%ebp),%eax
c01029b5:	29 d0                	sub    %edx,%eax
c01029b7:	c1 f8 02             	sar    $0x2,%eax
c01029ba:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
c01029c0:	5d                   	pop    %ebp
c01029c1:	c3                   	ret    

c01029c2 <page2pa>:

static inline uintptr_t
page2pa(struct Page *page) {
c01029c2:	55                   	push   %ebp
c01029c3:	89 e5                	mov    %esp,%ebp
c01029c5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c01029c8:	8b 45 08             	mov    0x8(%ebp),%eax
c01029cb:	89 04 24             	mov    %eax,(%esp)
c01029ce:	e8 d6 ff ff ff       	call   c01029a9 <page2ppn>
c01029d3:	c1 e0 0c             	shl    $0xc,%eax
}
c01029d6:	89 ec                	mov    %ebp,%esp
c01029d8:	5d                   	pop    %ebp
c01029d9:	c3                   	ret    

c01029da <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c01029da:	55                   	push   %ebp
c01029db:	89 e5                	mov    %esp,%ebp
    return page->ref;
c01029dd:	8b 45 08             	mov    0x8(%ebp),%eax
c01029e0:	8b 00                	mov    (%eax),%eax
}
c01029e2:	5d                   	pop    %ebp
c01029e3:	c3                   	ret    

c01029e4 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c01029e4:	55                   	push   %ebp
c01029e5:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c01029e7:	8b 45 08             	mov    0x8(%ebp),%eax
c01029ea:	8b 55 0c             	mov    0xc(%ebp),%edx
c01029ed:	89 10                	mov    %edx,(%eax)
}
c01029ef:	90                   	nop
c01029f0:	5d                   	pop    %ebp
c01029f1:	c3                   	ret    

c01029f2 <default_init>:
#define nr_free (free_area.nr_free)

//free_list` 用于记录空闲内存块,nr_free` 是空闲内存块的总数。
//用default_init函数来初始化 `free_list`,并将 `nr_free` 设置为 0。
static void
default_init(void) {
c01029f2:	55                   	push   %ebp
c01029f3:	89 e5                	mov    %esp,%ebp
c01029f5:	83 ec 10             	sub    $0x10,%esp
c01029f8:	c7 45 fc e0 ce 11 c0 	movl   $0xc011cee0,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c01029ff:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102a02:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0102a05:	89 50 04             	mov    %edx,0x4(%eax)
c0102a08:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102a0b:	8b 50 04             	mov    0x4(%eax),%edx
c0102a0e:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102a11:	89 10                	mov    %edx,(%eax)
}
c0102a13:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
c0102a14:	c7 05 e8 ce 11 c0 00 	movl   $0x0,0xc011cee8
c0102a1b:	00 00 00 
}
c0102a1e:	90                   	nop
c0102a1f:	89 ec                	mov    %ebp,%esp
c0102a21:	5d                   	pop    %ebp
c0102a22:	c3                   	ret    

c0102a23 <default_init_memmap>:

//用于初始化一段连续的物理页，并将它们加入到空闲内存管理系统中.
//struct Page *base：指向要初始化的页块的起始地址。size_t n：要初始化的页的数量。
static void
default_init_memmap(struct Page *base, size_t n) {
c0102a23:	55                   	push   %ebp
c0102a24:	89 e5                	mov    %esp,%ebp
c0102a26:	83 ec 48             	sub    $0x48,%esp
    assert(n > 0);//// 确保请求的页数大于零
c0102a29:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0102a2d:	75 24                	jne    c0102a53 <default_init_memmap+0x30>
c0102a2f:	c7 44 24 0c d0 67 10 	movl   $0xc01067d0,0xc(%esp)
c0102a36:	c0 
c0102a37:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102a3e:	c0 
c0102a3f:	c7 44 24 04 94 00 00 	movl   $0x94,0x4(%esp)
c0102a46:	00 
c0102a47:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102a4e:	e8 e0 e1 ff ff       	call   c0100c33 <__panic>
    struct Page *p = base;// 指向当前初始化的页
c0102a53:	8b 45 08             	mov    0x8(%ebp),%eax
c0102a56:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //// 遍历每一页，设置其状态
    for (; p != base + n; p ++) {
c0102a59:	eb 7d                	jmp    c0102ad8 <default_init_memmap+0xb5>
        assert(PageReserved(p));//检查每个页是否被标记为“保留”。若没有被保留，函数将抛出错误。
c0102a5b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102a5e:	83 c0 04             	add    $0x4,%eax
c0102a61:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0102a68:	89 45 ec             	mov    %eax,-0x14(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102a6b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102a6e:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0102a71:	0f a3 10             	bt     %edx,(%eax)
c0102a74:	19 c0                	sbb    %eax,%eax
c0102a76:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
c0102a79:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0102a7d:	0f 95 c0             	setne  %al
c0102a80:	0f b6 c0             	movzbl %al,%eax
c0102a83:	85 c0                	test   %eax,%eax
c0102a85:	75 24                	jne    c0102aab <default_init_memmap+0x88>
c0102a87:	c7 44 24 0c 01 68 10 	movl   $0xc0106801,0xc(%esp)
c0102a8e:	c0 
c0102a8f:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102a96:	c0 
c0102a97:	c7 44 24 04 98 00 00 	movl   $0x98,0x4(%esp)
c0102a9e:	00 
c0102a9f:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102aa6:	e8 88 e1 ff ff       	call   c0100c33 <__panic>
        p->flags = p->property = 0;//将页的 flags 和 property 字段设置为 0，表示该页未分配、未使用。
c0102aab:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102aae:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
c0102ab5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ab8:	8b 50 08             	mov    0x8(%eax),%edx
c0102abb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102abe:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);//将页的引用计数设置为 0，表明没有任何引用指向此页。
c0102ac1:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0102ac8:	00 
c0102ac9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102acc:	89 04 24             	mov    %eax,(%esp)
c0102acf:	e8 10 ff ff ff       	call   c01029e4 <set_page_ref>
    for (; p != base + n; p ++) {
c0102ad4:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
c0102ad8:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102adb:	89 d0                	mov    %edx,%eax
c0102add:	c1 e0 02             	shl    $0x2,%eax
c0102ae0:	01 d0                	add    %edx,%eax
c0102ae2:	c1 e0 02             	shl    $0x2,%eax
c0102ae5:	89 c2                	mov    %eax,%edx
c0102ae7:	8b 45 08             	mov    0x8(%ebp),%eax
c0102aea:	01 d0                	add    %edx,%eax
c0102aec:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102aef:	0f 85 66 ff ff ff    	jne    c0102a5b <default_init_memmap+0x38>
    }
    // 设置第一个页的 property 为块的总数
    base->property = n;
c0102af5:	8b 45 08             	mov    0x8(%ebp),%eax
c0102af8:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102afb:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);// 设置当前页的有效标志
c0102afe:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b01:	83 c0 04             	add    $0x4,%eax
c0102b04:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c0102b0b:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102b0e:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102b11:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102b14:	0f ab 10             	bts    %edx,(%eax)
}
c0102b17:	90                   	nop
    nr_free += n;// 更新空闲页计数
c0102b18:	8b 15 e8 ce 11 c0    	mov    0xc011cee8,%edx
c0102b1e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102b21:	01 d0                	add    %edx,%eax
c0102b23:	a3 e8 ce 11 c0       	mov    %eax,0xc011cee8
    list_add_before(&free_list, &(base->page_link)); // 将该块添加到空闲列表中
c0102b28:	8b 45 08             	mov    0x8(%ebp),%eax
c0102b2b:	83 c0 0c             	add    $0xc,%eax
c0102b2e:	c7 45 e4 e0 ce 11 c0 	movl   $0xc011cee0,-0x1c(%ebp)
c0102b35:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
c0102b38:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0102b3b:	8b 00                	mov    (%eax),%eax
c0102b3d:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0102b40:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0102b43:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0102b46:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0102b49:	89 45 d4             	mov    %eax,-0x2c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c0102b4c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102b4f:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0102b52:	89 10                	mov    %edx,(%eax)
c0102b54:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102b57:	8b 10                	mov    (%eax),%edx
c0102b59:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102b5c:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0102b5f:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102b62:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0102b65:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0102b68:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102b6b:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0102b6e:	89 10                	mov    %edx,(%eax)
}
c0102b70:	90                   	nop
}
c0102b71:	90                   	nop
}
c0102b72:	90                   	nop
c0102b73:	89 ec                	mov    %ebp,%esp
c0102b75:	5d                   	pop    %ebp
c0102b76:	c3                   	ret    

c0102b77 <default_alloc_pages>:

//用于分配指定数量的连续物理页。该函数实现了首次适应内存分配算法。
static struct Page *
default_alloc_pages(size_t n) {
c0102b77:	55                   	push   %ebp
c0102b78:	89 e5                	mov    %esp,%ebp
c0102b7a:	83 ec 68             	sub    $0x68,%esp
    assert(n > 0);// 确保请求的页数大于零
c0102b7d:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0102b81:	75 24                	jne    c0102ba7 <default_alloc_pages+0x30>
c0102b83:	c7 44 24 0c d0 67 10 	movl   $0xc01067d0,0xc(%esp)
c0102b8a:	c0 
c0102b8b:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102b92:	c0 
c0102b93:	c7 44 24 04 a6 00 00 	movl   $0xa6,0x4(%esp)
c0102b9a:	00 
c0102b9b:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102ba2:	e8 8c e0 ff ff       	call   c0100c33 <__panic>
    if (n > nr_free) {// 检查请求的页数是否超过空闲页数
c0102ba7:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c0102bac:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102baf:	76 0a                	jbe    c0102bbb <default_alloc_pages+0x44>
        return NULL;
c0102bb1:	b8 00 00 00 00       	mov    $0x0,%eax
c0102bb6:	e9 43 01 00 00       	jmp    c0102cfe <default_alloc_pages+0x187>
    }
    struct Page *page = NULL;// 初始化分配的页指针
c0102bbb:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list; // 初始化链表迭代器
c0102bc2:	c7 45 f0 e0 ce 11 c0 	movl   $0xc011cee0,-0x10(%ebp)
    // 遍历空闲列表，寻找第一个满足条件的块
    while ((le = list_next(le)) != &free_list) {
c0102bc9:	eb 1c                	jmp    c0102be7 <default_alloc_pages+0x70>
        struct Page *p = le2page(le, page_link);// 将链表节点转换为 Page 结构体
c0102bcb:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102bce:	83 e8 0c             	sub    $0xc,%eax
c0102bd1:	89 45 ec             	mov    %eax,-0x14(%ebp)
        if (p->property >= n) {// 检查当前块的页数是否满足请求
c0102bd4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102bd7:	8b 40 08             	mov    0x8(%eax),%eax
c0102bda:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102bdd:	77 08                	ja     c0102be7 <default_alloc_pages+0x70>
            page = p;// 找到合适的块
c0102bdf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0102be2:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;// 退出循环
c0102be5:	eb 18                	jmp    c0102bff <default_alloc_pages+0x88>
c0102be7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102bea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return listelm->next;
c0102bed:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0102bf0:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0102bf3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0102bf6:	81 7d f0 e0 ce 11 c0 	cmpl   $0xc011cee0,-0x10(%ebp)
c0102bfd:	75 cc                	jne    c0102bcb <default_alloc_pages+0x54>
        }
    }
    if (page != NULL) {// 如果找到合适的块
c0102bff:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0102c03:	0f 84 f2 00 00 00    	je     c0102cfb <default_alloc_pages+0x184>
        //list_del(&(page->page_link));// 从空闲列表中删除该块
        if (page->property > n) {
c0102c09:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102c0c:	8b 40 08             	mov    0x8(%eax),%eax
c0102c0f:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102c12:	0f 83 8f 00 00 00    	jae    c0102ca7 <default_alloc_pages+0x130>
            struct Page *p = page + n; // 指向剩余的页
c0102c18:	8b 55 08             	mov    0x8(%ebp),%edx
c0102c1b:	89 d0                	mov    %edx,%eax
c0102c1d:	c1 e0 02             	shl    $0x2,%eax
c0102c20:	01 d0                	add    %edx,%eax
c0102c22:	c1 e0 02             	shl    $0x2,%eax
c0102c25:	89 c2                	mov    %eax,%edx
c0102c27:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102c2a:	01 d0                	add    %edx,%eax
c0102c2c:	89 45 e8             	mov    %eax,-0x18(%ebp)
            p->property = page->property - n;// 更新剩余块的页数
c0102c2f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102c32:	8b 40 08             	mov    0x8(%eax),%eax
c0102c35:	2b 45 08             	sub    0x8(%ebp),%eax
c0102c38:	89 c2                	mov    %eax,%edx
c0102c3a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102c3d:	89 50 08             	mov    %edx,0x8(%eax)
            SetPageProperty(p);
c0102c40:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102c43:	83 c0 04             	add    $0x4,%eax
c0102c46:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
c0102c4d:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102c50:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0102c53:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0102c56:	0f ab 10             	bts    %edx,(%eax)
}
c0102c59:	90                   	nop
            list_add_after(&(page->page_link), &(p->page_link));// 将剩余块添加回空闲列表
c0102c5a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102c5d:	83 c0 0c             	add    $0xc,%eax
c0102c60:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0102c63:	83 c2 0c             	add    $0xc,%edx
c0102c66:	89 55 e0             	mov    %edx,-0x20(%ebp)
c0102c69:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_add(elm, listelm, listelm->next);
c0102c6c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0102c6f:	8b 40 04             	mov    0x4(%eax),%eax
c0102c72:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0102c75:	89 55 d8             	mov    %edx,-0x28(%ebp)
c0102c78:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0102c7b:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0102c7e:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next->prev = elm;
c0102c81:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102c84:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0102c87:	89 10                	mov    %edx,(%eax)
c0102c89:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102c8c:	8b 10                	mov    (%eax),%edx
c0102c8e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102c91:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0102c94:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102c97:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102c9a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0102c9d:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102ca0:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0102ca3:	89 10                	mov    %edx,(%eax)
}
c0102ca5:	90                   	nop
}
c0102ca6:	90                   	nop
    }
        list_del(&(page->page_link));
c0102ca7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102caa:	83 c0 0c             	add    $0xc,%eax
c0102cad:	89 45 bc             	mov    %eax,-0x44(%ebp)
    __list_del(listelm->prev, listelm->next);
c0102cb0:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0102cb3:	8b 40 04             	mov    0x4(%eax),%eax
c0102cb6:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0102cb9:	8b 12                	mov    (%edx),%edx
c0102cbb:	89 55 b8             	mov    %edx,-0x48(%ebp)
c0102cbe:	89 45 b4             	mov    %eax,-0x4c(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
c0102cc1:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0102cc4:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0102cc7:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0102cca:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0102ccd:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0102cd0:	89 10                	mov    %edx,(%eax)
}
c0102cd2:	90                   	nop
}
c0102cd3:	90                   	nop
        nr_free -= n;// 减少空闲页的计数
c0102cd4:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c0102cd9:	2b 45 08             	sub    0x8(%ebp),%eax
c0102cdc:	a3 e8 ce 11 c0       	mov    %eax,0xc011cee8
        ClearPageProperty(page); // 清除已分配页的属性
c0102ce1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ce4:	83 c0 04             	add    $0x4,%eax
c0102ce7:	c7 45 c4 01 00 00 00 	movl   $0x1,-0x3c(%ebp)
c0102cee:	89 45 c0             	mov    %eax,-0x40(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102cf1:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0102cf4:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0102cf7:	0f b3 10             	btr    %edx,(%eax)
}
c0102cfa:	90                   	nop
    }
    return page;// 返回分配的页块
c0102cfb:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0102cfe:	89 ec                	mov    %ebp,%esp
c0102d00:	5d                   	pop    %ebp
c0102d01:	c3                   	ret    

c0102d02 <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
c0102d02:	55                   	push   %ebp
c0102d03:	89 e5                	mov    %esp,%ebp
c0102d05:	81 ec 98 00 00 00    	sub    $0x98,%esp
    assert(n > 0);// 确保请求释放的页数大于零
c0102d0b:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0102d0f:	75 24                	jne    c0102d35 <default_free_pages+0x33>
c0102d11:	c7 44 24 0c d0 67 10 	movl   $0xc01067d0,0xc(%esp)
c0102d18:	c0 
c0102d19:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102d20:	c0 
c0102d21:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
c0102d28:	00 
c0102d29:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102d30:	e8 fe de ff ff       	call   c0100c33 <__panic>
    struct Page *p = base;
c0102d35:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d38:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 遍历释放的页，检查状态并重置
    for (; p != base + n; p ++) {
c0102d3b:	e9 9d 00 00 00       	jmp    c0102ddd <default_free_pages+0xdb>
        assert(!PageReserved(p) && !PageProperty(p)); // 确保页没有被保留并且没有属性
c0102d40:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102d43:	83 c0 04             	add    $0x4,%eax
c0102d46:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0102d4d:	89 45 e8             	mov    %eax,-0x18(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102d50:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102d53:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0102d56:	0f a3 10             	bt     %edx,(%eax)
c0102d59:	19 c0                	sbb    %eax,%eax
c0102d5b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
c0102d5e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0102d62:	0f 95 c0             	setne  %al
c0102d65:	0f b6 c0             	movzbl %al,%eax
c0102d68:	85 c0                	test   %eax,%eax
c0102d6a:	75 2c                	jne    c0102d98 <default_free_pages+0x96>
c0102d6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102d6f:	83 c0 04             	add    $0x4,%eax
c0102d72:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
c0102d79:	89 45 dc             	mov    %eax,-0x24(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102d7c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0102d7f:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0102d82:	0f a3 10             	bt     %edx,(%eax)
c0102d85:	19 c0                	sbb    %eax,%eax
c0102d87:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return oldbit != 0;
c0102d8a:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0102d8e:	0f 95 c0             	setne  %al
c0102d91:	0f b6 c0             	movzbl %al,%eax
c0102d94:	85 c0                	test   %eax,%eax
c0102d96:	74 24                	je     c0102dbc <default_free_pages+0xba>
c0102d98:	c7 44 24 0c 14 68 10 	movl   $0xc0106814,0xc(%esp)
c0102d9f:	c0 
c0102da0:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102da7:	c0 
c0102da8:	c7 44 24 04 c9 00 00 	movl   $0xc9,0x4(%esp)
c0102daf:	00 
c0102db0:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102db7:	e8 77 de ff ff       	call   c0100c33 <__panic>
        p->flags = 0;// 清除 flags 字段
c0102dbc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102dbf:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);// 清除引用计数
c0102dc6:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0102dcd:	00 
c0102dce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102dd1:	89 04 24             	mov    %eax,(%esp)
c0102dd4:	e8 0b fc ff ff       	call   c01029e4 <set_page_ref>
    for (; p != base + n; p ++) {
c0102dd9:	83 45 f4 14          	addl   $0x14,-0xc(%ebp)
c0102ddd:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102de0:	89 d0                	mov    %edx,%eax
c0102de2:	c1 e0 02             	shl    $0x2,%eax
c0102de5:	01 d0                	add    %edx,%eax
c0102de7:	c1 e0 02             	shl    $0x2,%eax
c0102dea:	89 c2                	mov    %eax,%edx
c0102dec:	8b 45 08             	mov    0x8(%ebp),%eax
c0102def:	01 d0                	add    %edx,%eax
c0102df1:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102df4:	0f 85 46 ff ff ff    	jne    c0102d40 <default_free_pages+0x3e>
    }
    // 设置基页的属性为释放的页数
    base->property = n;
c0102dfa:	8b 45 08             	mov    0x8(%ebp),%eax
c0102dfd:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102e00:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);// 设置页的有效标志
c0102e03:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e06:	83 c0 04             	add    $0x4,%eax
c0102e09:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c0102e10:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102e13:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0102e16:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102e19:	0f ab 10             	bts    %edx,(%eax)
}
c0102e1c:	90                   	nop
c0102e1d:	c7 45 d4 e0 ce 11 c0 	movl   $0xc011cee0,-0x2c(%ebp)
    return listelm->next;
c0102e24:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102e27:	8b 40 04             	mov    0x4(%eax),%eax
    // 遍历空闲列表，检查是否需要合并
    list_entry_t *le = list_next(&free_list);
c0102e2a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
c0102e2d:	e9 0e 01 00 00       	jmp    c0102f40 <default_free_pages+0x23e>
        p = le2page(le, page_link);
c0102e32:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102e35:	83 e8 0c             	sub    $0xc,%eax
c0102e38:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0102e3b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102e3e:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0102e41:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0102e44:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0102e47:	89 45 f0             	mov    %eax,-0x10(%ebp)
        // 如果当前页块与释放的页块相邻，合并
        if (base + base->property == p) {
c0102e4a:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e4d:	8b 50 08             	mov    0x8(%eax),%edx
c0102e50:	89 d0                	mov    %edx,%eax
c0102e52:	c1 e0 02             	shl    $0x2,%eax
c0102e55:	01 d0                	add    %edx,%eax
c0102e57:	c1 e0 02             	shl    $0x2,%eax
c0102e5a:	89 c2                	mov    %eax,%edx
c0102e5c:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e5f:	01 d0                	add    %edx,%eax
c0102e61:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102e64:	75 5d                	jne    c0102ec3 <default_free_pages+0x1c1>
            base->property += p->property;// 合并当前页块
c0102e66:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e69:	8b 50 08             	mov    0x8(%eax),%edx
c0102e6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e6f:	8b 40 08             	mov    0x8(%eax),%eax
c0102e72:	01 c2                	add    %eax,%edx
c0102e74:	8b 45 08             	mov    0x8(%ebp),%eax
c0102e77:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);// 清除合并页的属性
c0102e7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e7d:	83 c0 04             	add    $0x4,%eax
c0102e80:	c7 45 b8 01 00 00 00 	movl   $0x1,-0x48(%ebp)
c0102e87:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102e8a:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0102e8d:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0102e90:	0f b3 10             	btr    %edx,(%eax)
}
c0102e93:	90                   	nop
            list_del(&(p->page_link));// 从空闲列表中删除合并页
c0102e94:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e97:	83 c0 0c             	add    $0xc,%eax
c0102e9a:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    __list_del(listelm->prev, listelm->next);
c0102e9d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0102ea0:	8b 40 04             	mov    0x4(%eax),%eax
c0102ea3:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0102ea6:	8b 12                	mov    (%edx),%edx
c0102ea8:	89 55 c0             	mov    %edx,-0x40(%ebp)
c0102eab:	89 45 bc             	mov    %eax,-0x44(%ebp)
    prev->next = next;
c0102eae:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0102eb1:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0102eb4:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0102eb7:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0102eba:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0102ebd:	89 10                	mov    %edx,(%eax)
}
c0102ebf:	90                   	nop
}
c0102ec0:	90                   	nop
c0102ec1:	eb 7d                	jmp    c0102f40 <default_free_pages+0x23e>
        }
        else if (p + p->property == base) {
c0102ec3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ec6:	8b 50 08             	mov    0x8(%eax),%edx
c0102ec9:	89 d0                	mov    %edx,%eax
c0102ecb:	c1 e0 02             	shl    $0x2,%eax
c0102ece:	01 d0                	add    %edx,%eax
c0102ed0:	c1 e0 02             	shl    $0x2,%eax
c0102ed3:	89 c2                	mov    %eax,%edx
c0102ed5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ed8:	01 d0                	add    %edx,%eax
c0102eda:	39 45 08             	cmp    %eax,0x8(%ebp)
c0102edd:	75 61                	jne    c0102f40 <default_free_pages+0x23e>
            p->property += base->property;// 合并前一个页块
c0102edf:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ee2:	8b 50 08             	mov    0x8(%eax),%edx
c0102ee5:	8b 45 08             	mov    0x8(%ebp),%eax
c0102ee8:	8b 40 08             	mov    0x8(%eax),%eax
c0102eeb:	01 c2                	add    %eax,%edx
c0102eed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102ef0:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);// 清除当前页的属性
c0102ef3:	8b 45 08             	mov    0x8(%ebp),%eax
c0102ef6:	83 c0 04             	add    $0x4,%eax
c0102ef9:	c7 45 a4 01 00 00 00 	movl   $0x1,-0x5c(%ebp)
c0102f00:	89 45 a0             	mov    %eax,-0x60(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102f03:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0102f06:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0102f09:	0f b3 10             	btr    %edx,(%eax)
}
c0102f0c:	90                   	nop
            base = p;// 更新 base 指针
c0102f0d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102f10:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link)); // 从空闲列表中删除当前页
c0102f13:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102f16:	83 c0 0c             	add    $0xc,%eax
c0102f19:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
c0102f1c:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0102f1f:	8b 40 04             	mov    0x4(%eax),%eax
c0102f22:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0102f25:	8b 12                	mov    (%edx),%edx
c0102f27:	89 55 ac             	mov    %edx,-0x54(%ebp)
c0102f2a:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
c0102f2d:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0102f30:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0102f33:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0102f36:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0102f39:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0102f3c:	89 10                	mov    %edx,(%eax)
}
c0102f3e:	90                   	nop
}
c0102f3f:	90                   	nop
    while (le != &free_list) {
c0102f40:	81 7d f0 e0 ce 11 c0 	cmpl   $0xc011cee0,-0x10(%ebp)
c0102f47:	0f 85 e5 fe ff ff    	jne    c0102e32 <default_free_pages+0x130>
        }
    }
    nr_free += n;// 更新空闲页的计数
c0102f4d:	8b 15 e8 ce 11 c0    	mov    0xc011cee8,%edx
c0102f53:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f56:	01 d0                	add    %edx,%eax
c0102f58:	a3 e8 ce 11 c0       	mov    %eax,0xc011cee8
c0102f5d:	c7 45 9c e0 ce 11 c0 	movl   $0xc011cee0,-0x64(%ebp)
    return listelm->next;
c0102f64:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0102f67:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(&free_list);
c0102f6a:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list)
c0102f6d:	eb 74                	jmp    c0102fe3 <default_free_pages+0x2e1>
    {
        p = le2page(le, page_link);
c0102f6f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102f72:	83 e8 0c             	sub    $0xc,%eax
c0102f75:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (base + base->property <= p)
c0102f78:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f7b:	8b 50 08             	mov    0x8(%eax),%edx
c0102f7e:	89 d0                	mov    %edx,%eax
c0102f80:	c1 e0 02             	shl    $0x2,%eax
c0102f83:	01 d0                	add    %edx,%eax
c0102f85:	c1 e0 02             	shl    $0x2,%eax
c0102f88:	89 c2                	mov    %eax,%edx
c0102f8a:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f8d:	01 d0                	add    %edx,%eax
c0102f8f:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102f92:	72 40                	jb     c0102fd4 <default_free_pages+0x2d2>
        {
            assert(base + base->property != p);
c0102f94:	8b 45 08             	mov    0x8(%ebp),%eax
c0102f97:	8b 50 08             	mov    0x8(%eax),%edx
c0102f9a:	89 d0                	mov    %edx,%eax
c0102f9c:	c1 e0 02             	shl    $0x2,%eax
c0102f9f:	01 d0                	add    %edx,%eax
c0102fa1:	c1 e0 02             	shl    $0x2,%eax
c0102fa4:	89 c2                	mov    %eax,%edx
c0102fa6:	8b 45 08             	mov    0x8(%ebp),%eax
c0102fa9:	01 d0                	add    %edx,%eax
c0102fab:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102fae:	75 3e                	jne    c0102fee <default_free_pages+0x2ec>
c0102fb0:	c7 44 24 0c 39 68 10 	movl   $0xc0106839,0xc(%esp)
c0102fb7:	c0 
c0102fb8:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0102fbf:	c0 
c0102fc0:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
c0102fc7:	00 
c0102fc8:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0102fcf:	e8 5f dc ff ff       	call   c0100c33 <__panic>
c0102fd4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102fd7:	89 45 98             	mov    %eax,-0x68(%ebp)
c0102fda:	8b 45 98             	mov    -0x68(%ebp),%eax
c0102fdd:	8b 40 04             	mov    0x4(%eax),%eax
            break;
        }
        le = list_next(le);    
c0102fe0:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list)
c0102fe3:	81 7d f0 e0 ce 11 c0 	cmpl   $0xc011cee0,-0x10(%ebp)
c0102fea:	75 83                	jne    c0102f6f <default_free_pages+0x26d>
c0102fec:	eb 01                	jmp    c0102fef <default_free_pages+0x2ed>
            break;
c0102fee:	90                   	nop
    }
    
    list_add_before(le, &(base->page_link));// 将释放的页块添加到空闲列表中
c0102fef:	8b 45 08             	mov    0x8(%ebp),%eax
c0102ff2:	8d 50 0c             	lea    0xc(%eax),%edx
c0102ff5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0102ff8:	89 45 94             	mov    %eax,-0x6c(%ebp)
c0102ffb:	89 55 90             	mov    %edx,-0x70(%ebp)
    __list_add(elm, listelm->prev, listelm);
c0102ffe:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0103001:	8b 00                	mov    (%eax),%eax
c0103003:	8b 55 90             	mov    -0x70(%ebp),%edx
c0103006:	89 55 8c             	mov    %edx,-0x74(%ebp)
c0103009:	89 45 88             	mov    %eax,-0x78(%ebp)
c010300c:	8b 45 94             	mov    -0x6c(%ebp),%eax
c010300f:	89 45 84             	mov    %eax,-0x7c(%ebp)
    prev->next = next->prev = elm;
c0103012:	8b 45 84             	mov    -0x7c(%ebp),%eax
c0103015:	8b 55 8c             	mov    -0x74(%ebp),%edx
c0103018:	89 10                	mov    %edx,(%eax)
c010301a:	8b 45 84             	mov    -0x7c(%ebp),%eax
c010301d:	8b 10                	mov    (%eax),%edx
c010301f:	8b 45 88             	mov    -0x78(%ebp),%eax
c0103022:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0103025:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0103028:	8b 55 84             	mov    -0x7c(%ebp),%edx
c010302b:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c010302e:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0103031:	8b 55 88             	mov    -0x78(%ebp),%edx
c0103034:	89 10                	mov    %edx,(%eax)
}
c0103036:	90                   	nop
}
c0103037:	90                   	nop
}
c0103038:	90                   	nop
c0103039:	89 ec                	mov    %ebp,%esp
c010303b:	5d                   	pop    %ebp
c010303c:	c3                   	ret    

c010303d <default_nr_free_pages>:

//用于返回当前系统中可用的空闲页的数量。
static size_t
default_nr_free_pages(void) {
c010303d:	55                   	push   %ebp
c010303e:	89 e5                	mov    %esp,%ebp
    return nr_free;// 返回当前空闲页的数量
c0103040:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
}
c0103045:	5d                   	pop    %ebp
c0103046:	c3                   	ret    

c0103047 <basic_check>:

//basic_check 函数用于测试内存分配和释放的基本功能，
//确保在不同情况下内存管理系统的正确性，包括分配、释放、合并和引用计数等操作。
static void
basic_check(void) {
c0103047:	55                   	push   %ebp
c0103048:	89 e5                	mov    %esp,%ebp
c010304a:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c010304d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103054:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103057:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010305a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010305d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    // 分配三个页面
    assert((p0 = alloc_page()) != NULL);
c0103060:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103067:	e8 af 0e 00 00       	call   c0103f1b <alloc_pages>
c010306c:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010306f:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103073:	75 24                	jne    c0103099 <basic_check+0x52>
c0103075:	c7 44 24 0c 54 68 10 	movl   $0xc0106854,0xc(%esp)
c010307c:	c0 
c010307d:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103084:	c0 
c0103085:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
c010308c:	00 
c010308d:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103094:	e8 9a db ff ff       	call   c0100c33 <__panic>
    assert((p1 = alloc_page()) != NULL);
c0103099:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01030a0:	e8 76 0e 00 00       	call   c0103f1b <alloc_pages>
c01030a5:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01030a8:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01030ac:	75 24                	jne    c01030d2 <basic_check+0x8b>
c01030ae:	c7 44 24 0c 70 68 10 	movl   $0xc0106870,0xc(%esp)
c01030b5:	c0 
c01030b6:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01030bd:	c0 
c01030be:	c7 44 24 04 00 01 00 	movl   $0x100,0x4(%esp)
c01030c5:	00 
c01030c6:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01030cd:	e8 61 db ff ff       	call   c0100c33 <__panic>
    assert((p2 = alloc_page()) != NULL);
c01030d2:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01030d9:	e8 3d 0e 00 00       	call   c0103f1b <alloc_pages>
c01030de:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01030e1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01030e5:	75 24                	jne    c010310b <basic_check+0xc4>
c01030e7:	c7 44 24 0c 8c 68 10 	movl   $0xc010688c,0xc(%esp)
c01030ee:	c0 
c01030ef:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01030f6:	c0 
c01030f7:	c7 44 24 04 01 01 00 	movl   $0x101,0x4(%esp)
c01030fe:	00 
c01030ff:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103106:	e8 28 db ff ff       	call   c0100c33 <__panic>
    // 确保所有分配的页面是不同的
    assert(p0 != p1 && p0 != p2 && p1 != p2);
c010310b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010310e:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0103111:	74 10                	je     c0103123 <basic_check+0xdc>
c0103113:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103116:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c0103119:	74 08                	je     c0103123 <basic_check+0xdc>
c010311b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010311e:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c0103121:	75 24                	jne    c0103147 <basic_check+0x100>
c0103123:	c7 44 24 0c a8 68 10 	movl   $0xc01068a8,0xc(%esp)
c010312a:	c0 
c010312b:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103132:	c0 
c0103133:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
c010313a:	00 
c010313b:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103142:	e8 ec da ff ff       	call   c0100c33 <__panic>
    // 确保页面的引用计数为 0
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
c0103147:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010314a:	89 04 24             	mov    %eax,(%esp)
c010314d:	e8 88 f8 ff ff       	call   c01029da <page_ref>
c0103152:	85 c0                	test   %eax,%eax
c0103154:	75 1e                	jne    c0103174 <basic_check+0x12d>
c0103156:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103159:	89 04 24             	mov    %eax,(%esp)
c010315c:	e8 79 f8 ff ff       	call   c01029da <page_ref>
c0103161:	85 c0                	test   %eax,%eax
c0103163:	75 0f                	jne    c0103174 <basic_check+0x12d>
c0103165:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103168:	89 04 24             	mov    %eax,(%esp)
c010316b:	e8 6a f8 ff ff       	call   c01029da <page_ref>
c0103170:	85 c0                	test   %eax,%eax
c0103172:	74 24                	je     c0103198 <basic_check+0x151>
c0103174:	c7 44 24 0c cc 68 10 	movl   $0xc01068cc,0xc(%esp)
c010317b:	c0 
c010317c:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103183:	c0 
c0103184:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
c010318b:	00 
c010318c:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103193:	e8 9b da ff ff       	call   c0100c33 <__panic>
    // 确保页面地址在合法范围内
    assert(page2pa(p0) < npage * PGSIZE);
c0103198:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010319b:	89 04 24             	mov    %eax,(%esp)
c010319e:	e8 1f f8 ff ff       	call   c01029c2 <page2pa>
c01031a3:	8b 15 04 cf 11 c0    	mov    0xc011cf04,%edx
c01031a9:	c1 e2 0c             	shl    $0xc,%edx
c01031ac:	39 d0                	cmp    %edx,%eax
c01031ae:	72 24                	jb     c01031d4 <basic_check+0x18d>
c01031b0:	c7 44 24 0c 08 69 10 	movl   $0xc0106908,0xc(%esp)
c01031b7:	c0 
c01031b8:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01031bf:	c0 
c01031c0:	c7 44 24 04 07 01 00 	movl   $0x107,0x4(%esp)
c01031c7:	00 
c01031c8:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01031cf:	e8 5f da ff ff       	call   c0100c33 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
c01031d4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01031d7:	89 04 24             	mov    %eax,(%esp)
c01031da:	e8 e3 f7 ff ff       	call   c01029c2 <page2pa>
c01031df:	8b 15 04 cf 11 c0    	mov    0xc011cf04,%edx
c01031e5:	c1 e2 0c             	shl    $0xc,%edx
c01031e8:	39 d0                	cmp    %edx,%eax
c01031ea:	72 24                	jb     c0103210 <basic_check+0x1c9>
c01031ec:	c7 44 24 0c 25 69 10 	movl   $0xc0106925,0xc(%esp)
c01031f3:	c0 
c01031f4:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01031fb:	c0 
c01031fc:	c7 44 24 04 08 01 00 	movl   $0x108,0x4(%esp)
c0103203:	00 
c0103204:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010320b:	e8 23 da ff ff       	call   c0100c33 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
c0103210:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103213:	89 04 24             	mov    %eax,(%esp)
c0103216:	e8 a7 f7 ff ff       	call   c01029c2 <page2pa>
c010321b:	8b 15 04 cf 11 c0    	mov    0xc011cf04,%edx
c0103221:	c1 e2 0c             	shl    $0xc,%edx
c0103224:	39 d0                	cmp    %edx,%eax
c0103226:	72 24                	jb     c010324c <basic_check+0x205>
c0103228:	c7 44 24 0c 42 69 10 	movl   $0xc0106942,0xc(%esp)
c010322f:	c0 
c0103230:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103237:	c0 
c0103238:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
c010323f:	00 
c0103240:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103247:	e8 e7 d9 ff ff       	call   c0100c33 <__panic>
    // 保存当前的空闲页面链表和数量
    list_entry_t free_list_store = free_list;
c010324c:	a1 e0 ce 11 c0       	mov    0xc011cee0,%eax
c0103251:	8b 15 e4 ce 11 c0    	mov    0xc011cee4,%edx
c0103257:	89 45 d0             	mov    %eax,-0x30(%ebp)
c010325a:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010325d:	c7 45 dc e0 ce 11 c0 	movl   $0xc011cee0,-0x24(%ebp)
    elm->prev = elm->next = elm;
c0103264:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103267:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010326a:	89 50 04             	mov    %edx,0x4(%eax)
c010326d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103270:	8b 50 04             	mov    0x4(%eax),%edx
c0103273:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103276:	89 10                	mov    %edx,(%eax)
}
c0103278:	90                   	nop
c0103279:	c7 45 e0 e0 ce 11 c0 	movl   $0xc011cee0,-0x20(%ebp)
    return list->next == list;
c0103280:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103283:	8b 40 04             	mov    0x4(%eax),%eax
c0103286:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0103289:	0f 94 c0             	sete   %al
c010328c:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);// 初始化空闲列表
    assert(list_empty(&free_list));// 确保空闲列表为空
c010328f:	85 c0                	test   %eax,%eax
c0103291:	75 24                	jne    c01032b7 <basic_check+0x270>
c0103293:	c7 44 24 0c 5f 69 10 	movl   $0xc010695f,0xc(%esp)
c010329a:	c0 
c010329b:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01032a2:	c0 
c01032a3:	c7 44 24 04 0d 01 00 	movl   $0x10d,0x4(%esp)
c01032aa:	00 
c01032ab:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01032b2:	e8 7c d9 ff ff       	call   c0100c33 <__panic>

    unsigned int nr_free_store = nr_free;// 保存当前空闲页数量
c01032b7:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c01032bc:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;// 将空闲页数量设为 0
c01032bf:	c7 05 e8 ce 11 c0 00 	movl   $0x0,0xc011cee8
c01032c6:	00 00 00 
    // 请求分配页面，但当前没有空闲页面
    assert(alloc_page() == NULL);
c01032c9:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01032d0:	e8 46 0c 00 00       	call   c0103f1b <alloc_pages>
c01032d5:	85 c0                	test   %eax,%eax
c01032d7:	74 24                	je     c01032fd <basic_check+0x2b6>
c01032d9:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c01032e0:	c0 
c01032e1:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01032e8:	c0 
c01032e9:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
c01032f0:	00 
c01032f1:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01032f8:	e8 36 d9 ff ff       	call   c0100c33 <__panic>
    // 释放之前分配的页面
    free_page(p0);
c01032fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103304:	00 
c0103305:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103308:	89 04 24             	mov    %eax,(%esp)
c010330b:	e8 45 0c 00 00       	call   c0103f55 <free_pages>
    free_page(p1);
c0103310:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103317:	00 
c0103318:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010331b:	89 04 24             	mov    %eax,(%esp)
c010331e:	e8 32 0c 00 00       	call   c0103f55 <free_pages>
    free_page(p2);
c0103323:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010332a:	00 
c010332b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010332e:	89 04 24             	mov    %eax,(%esp)
c0103331:	e8 1f 0c 00 00       	call   c0103f55 <free_pages>
    assert(nr_free == 3);// 确保释放后空闲页数量为 3
c0103336:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c010333b:	83 f8 03             	cmp    $0x3,%eax
c010333e:	74 24                	je     c0103364 <basic_check+0x31d>
c0103340:	c7 44 24 0c 8b 69 10 	movl   $0xc010698b,0xc(%esp)
c0103347:	c0 
c0103348:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010334f:	c0 
c0103350:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
c0103357:	00 
c0103358:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010335f:	e8 cf d8 ff ff       	call   c0100c33 <__panic>
    // 再次分配三个页面
    assert((p0 = alloc_page()) != NULL);
c0103364:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010336b:	e8 ab 0b 00 00       	call   c0103f1b <alloc_pages>
c0103370:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103373:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103377:	75 24                	jne    c010339d <basic_check+0x356>
c0103379:	c7 44 24 0c 54 68 10 	movl   $0xc0106854,0xc(%esp)
c0103380:	c0 
c0103381:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103388:	c0 
c0103389:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
c0103390:	00 
c0103391:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103398:	e8 96 d8 ff ff       	call   c0100c33 <__panic>
    assert((p1 = alloc_page()) != NULL);
c010339d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01033a4:	e8 72 0b 00 00       	call   c0103f1b <alloc_pages>
c01033a9:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01033ac:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01033b0:	75 24                	jne    c01033d6 <basic_check+0x38f>
c01033b2:	c7 44 24 0c 70 68 10 	movl   $0xc0106870,0xc(%esp)
c01033b9:	c0 
c01033ba:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01033c1:	c0 
c01033c2:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
c01033c9:	00 
c01033ca:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01033d1:	e8 5d d8 ff ff       	call   c0100c33 <__panic>
    assert((p2 = alloc_page()) != NULL);
c01033d6:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01033dd:	e8 39 0b 00 00       	call   c0103f1b <alloc_pages>
c01033e2:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01033e5:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01033e9:	75 24                	jne    c010340f <basic_check+0x3c8>
c01033eb:	c7 44 24 0c 8c 68 10 	movl   $0xc010688c,0xc(%esp)
c01033f2:	c0 
c01033f3:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01033fa:	c0 
c01033fb:	c7 44 24 04 1b 01 00 	movl   $0x11b,0x4(%esp)
c0103402:	00 
c0103403:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010340a:	e8 24 d8 ff ff       	call   c0100c33 <__panic>
// 测试空闲页面是否不足
    assert(alloc_page() == NULL);
c010340f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103416:	e8 00 0b 00 00       	call   c0103f1b <alloc_pages>
c010341b:	85 c0                	test   %eax,%eax
c010341d:	74 24                	je     c0103443 <basic_check+0x3fc>
c010341f:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c0103426:	c0 
c0103427:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010342e:	c0 
c010342f:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
c0103436:	00 
c0103437:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010343e:	e8 f0 d7 ff ff       	call   c0100c33 <__panic>
// 释放 p0，并检查空闲列表
    free_page(p0);
c0103443:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010344a:	00 
c010344b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010344e:	89 04 24             	mov    %eax,(%esp)
c0103451:	e8 ff 0a 00 00       	call   c0103f55 <free_pages>
c0103456:	c7 45 d8 e0 ce 11 c0 	movl   $0xc011cee0,-0x28(%ebp)
c010345d:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103460:	8b 40 04             	mov    0x4(%eax),%eax
c0103463:	39 45 d8             	cmp    %eax,-0x28(%ebp)
c0103466:	0f 94 c0             	sete   %al
c0103469:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));// 确保空闲列表不为空
c010346c:	85 c0                	test   %eax,%eax
c010346e:	74 24                	je     c0103494 <basic_check+0x44d>
c0103470:	c7 44 24 0c 98 69 10 	movl   $0xc0106998,0xc(%esp)
c0103477:	c0 
c0103478:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010347f:	c0 
c0103480:	c7 44 24 04 20 01 00 	movl   $0x120,0x4(%esp)
c0103487:	00 
c0103488:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010348f:	e8 9f d7 ff ff       	call   c0100c33 <__panic>

    struct Page *p;
    // 重新分配 p0，确保取回的是相同的页面
    assert((p = alloc_page()) == p0);
c0103494:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010349b:	e8 7b 0a 00 00       	call   c0103f1b <alloc_pages>
c01034a0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01034a3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01034a6:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01034a9:	74 24                	je     c01034cf <basic_check+0x488>
c01034ab:	c7 44 24 0c b0 69 10 	movl   $0xc01069b0,0xc(%esp)
c01034b2:	c0 
c01034b3:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01034ba:	c0 
c01034bb:	c7 44 24 04 24 01 00 	movl   $0x124,0x4(%esp)
c01034c2:	00 
c01034c3:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01034ca:	e8 64 d7 ff ff       	call   c0100c33 <__panic>
    assert(alloc_page() == NULL); // 确保没有更多的页面可分配
c01034cf:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01034d6:	e8 40 0a 00 00       	call   c0103f1b <alloc_pages>
c01034db:	85 c0                	test   %eax,%eax
c01034dd:	74 24                	je     c0103503 <basic_check+0x4bc>
c01034df:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c01034e6:	c0 
c01034e7:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01034ee:	c0 
c01034ef:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
c01034f6:	00 
c01034f7:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01034fe:	e8 30 d7 ff ff       	call   c0100c33 <__panic>

    assert(nr_free == 0);// 确保当前空闲页面数量为 0
c0103503:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c0103508:	85 c0                	test   %eax,%eax
c010350a:	74 24                	je     c0103530 <basic_check+0x4e9>
c010350c:	c7 44 24 0c c9 69 10 	movl   $0xc01069c9,0xc(%esp)
c0103513:	c0 
c0103514:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010351b:	c0 
c010351c:	c7 44 24 04 27 01 00 	movl   $0x127,0x4(%esp)
c0103523:	00 
c0103524:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010352b:	e8 03 d7 ff ff       	call   c0100c33 <__panic>
    // 恢复之前的空闲页面链表和数量
    free_list = free_list_store;
c0103530:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0103533:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0103536:	a3 e0 ce 11 c0       	mov    %eax,0xc011cee0
c010353b:	89 15 e4 ce 11 c0    	mov    %edx,0xc011cee4
    nr_free = nr_free_store;
c0103541:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103544:	a3 e8 ce 11 c0       	mov    %eax,0xc011cee8
 // 释放最后的页面
    free_page(p);
c0103549:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103550:	00 
c0103551:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103554:	89 04 24             	mov    %eax,(%esp)
c0103557:	e8 f9 09 00 00       	call   c0103f55 <free_pages>
    free_page(p1);
c010355c:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103563:	00 
c0103564:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103567:	89 04 24             	mov    %eax,(%esp)
c010356a:	e8 e6 09 00 00       	call   c0103f55 <free_pages>
    free_page(p2);
c010356f:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103576:	00 
c0103577:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010357a:	89 04 24             	mov    %eax,(%esp)
c010357d:	e8 d3 09 00 00       	call   c0103f55 <free_pages>
}
c0103582:	90                   	nop
c0103583:	89 ec                	mov    %ebp,%esp
c0103585:	5d                   	pop    %ebp
c0103586:	c3                   	ret    

c0103587 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
c0103587:	55                   	push   %ebp
c0103588:	89 e5                	mov    %esp,%ebp
c010358a:	81 ec 98 00 00 00    	sub    $0x98,%esp
    int count = 0, total = 0;
c0103590:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103597:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
c010359e:	c7 45 ec e0 ce 11 c0 	movl   $0xc011cee0,-0x14(%ebp)
    // 遍历空闲列表，计算空闲页面的数量和总属性值
    while ((le = list_next(le)) != &free_list) {
c01035a5:	eb 6a                	jmp    c0103611 <default_check+0x8a>
        struct Page *p = le2page(le, page_link);
c01035a7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01035aa:	83 e8 0c             	sub    $0xc,%eax
c01035ad:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));// 确保每个页面的属性是有效的
c01035b0:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01035b3:	83 c0 04             	add    $0x4,%eax
c01035b6:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c01035bd:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01035c0:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01035c3:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01035c6:	0f a3 10             	bt     %edx,(%eax)
c01035c9:	19 c0                	sbb    %eax,%eax
c01035cb:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
c01035ce:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c01035d2:	0f 95 c0             	setne  %al
c01035d5:	0f b6 c0             	movzbl %al,%eax
c01035d8:	85 c0                	test   %eax,%eax
c01035da:	75 24                	jne    c0103600 <default_check+0x79>
c01035dc:	c7 44 24 0c d6 69 10 	movl   $0xc01069d6,0xc(%esp)
c01035e3:	c0 
c01035e4:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01035eb:	c0 
c01035ec:	c7 44 24 04 3a 01 00 	movl   $0x13a,0x4(%esp)
c01035f3:	00 
c01035f4:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01035fb:	e8 33 d6 ff ff       	call   c0100c33 <__panic>
        count ++, total += p->property;// 累加页面属性
c0103600:	ff 45 f4             	incl   -0xc(%ebp)
c0103603:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103606:	8b 50 08             	mov    0x8(%eax),%edx
c0103609:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010360c:	01 d0                	add    %edx,%eax
c010360e:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103611:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103614:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
c0103617:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010361a:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c010361d:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103620:	81 7d ec e0 ce 11 c0 	cmpl   $0xc011cee0,-0x14(%ebp)
c0103627:	0f 85 7a ff ff ff    	jne    c01035a7 <default_check+0x20>
    }
    // 确保总属性值与空闲页面数量匹配
    assert(total == nr_free_pages());
c010362d:	e8 58 09 00 00       	call   c0103f8a <nr_free_pages>
c0103632:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103635:	39 d0                	cmp    %edx,%eax
c0103637:	74 24                	je     c010365d <default_check+0xd6>
c0103639:	c7 44 24 0c e6 69 10 	movl   $0xc01069e6,0xc(%esp)
c0103640:	c0 
c0103641:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103648:	c0 
c0103649:	c7 44 24 04 3e 01 00 	movl   $0x13e,0x4(%esp)
c0103650:	00 
c0103651:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103658:	e8 d6 d5 ff ff       	call   c0100c33 <__panic>
    // 调用 basic_check 以验证基本的内存管理功能
    basic_check();
c010365d:	e8 e5 f9 ff ff       	call   c0103047 <basic_check>
    // 分配 5 个页面
    struct Page *p0 = alloc_pages(5), *p1, *p2;
c0103662:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0103669:	e8 ad 08 00 00       	call   c0103f1b <alloc_pages>
c010366e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);// 确保成功分配
c0103671:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0103675:	75 24                	jne    c010369b <default_check+0x114>
c0103677:	c7 44 24 0c ff 69 10 	movl   $0xc01069ff,0xc(%esp)
c010367e:	c0 
c010367f:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103686:	c0 
c0103687:	c7 44 24 04 43 01 00 	movl   $0x143,0x4(%esp)
c010368e:	00 
c010368f:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103696:	e8 98 d5 ff ff       	call   c0100c33 <__panic>
    assert(!PageProperty(p0));// 确保分配的页面不带属性
c010369b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010369e:	83 c0 04             	add    $0x4,%eax
c01036a1:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
c01036a8:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01036ab:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01036ae:	8b 55 c0             	mov    -0x40(%ebp),%edx
c01036b1:	0f a3 10             	bt     %edx,(%eax)
c01036b4:	19 c0                	sbb    %eax,%eax
c01036b6:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
c01036b9:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
c01036bd:	0f 95 c0             	setne  %al
c01036c0:	0f b6 c0             	movzbl %al,%eax
c01036c3:	85 c0                	test   %eax,%eax
c01036c5:	74 24                	je     c01036eb <default_check+0x164>
c01036c7:	c7 44 24 0c 0a 6a 10 	movl   $0xc0106a0a,0xc(%esp)
c01036ce:	c0 
c01036cf:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01036d6:	c0 
c01036d7:	c7 44 24 04 44 01 00 	movl   $0x144,0x4(%esp)
c01036de:	00 
c01036df:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01036e6:	e8 48 d5 ff ff       	call   c0100c33 <__panic>
     // 初始化并检查空闲列表
    list_entry_t free_list_store = free_list;
c01036eb:	a1 e0 ce 11 c0       	mov    0xc011cee0,%eax
c01036f0:	8b 15 e4 ce 11 c0    	mov    0xc011cee4,%edx
c01036f6:	89 45 80             	mov    %eax,-0x80(%ebp)
c01036f9:	89 55 84             	mov    %edx,-0x7c(%ebp)
c01036fc:	c7 45 b0 e0 ce 11 c0 	movl   $0xc011cee0,-0x50(%ebp)
    elm->prev = elm->next = elm;
c0103703:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0103706:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0103709:	89 50 04             	mov    %edx,0x4(%eax)
c010370c:	8b 45 b0             	mov    -0x50(%ebp),%eax
c010370f:	8b 50 04             	mov    0x4(%eax),%edx
c0103712:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0103715:	89 10                	mov    %edx,(%eax)
}
c0103717:	90                   	nop
c0103718:	c7 45 b4 e0 ce 11 c0 	movl   $0xc011cee0,-0x4c(%ebp)
    return list->next == list;
c010371f:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0103722:	8b 40 04             	mov    0x4(%eax),%eax
c0103725:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
c0103728:	0f 94 c0             	sete   %al
c010372b:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));// 确保空闲列表为空
c010372e:	85 c0                	test   %eax,%eax
c0103730:	75 24                	jne    c0103756 <default_check+0x1cf>
c0103732:	c7 44 24 0c 5f 69 10 	movl   $0xc010695f,0xc(%esp)
c0103739:	c0 
c010373a:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103741:	c0 
c0103742:	c7 44 24 04 48 01 00 	movl   $0x148,0x4(%esp)
c0103749:	00 
c010374a:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103751:	e8 dd d4 ff ff       	call   c0100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有页面可分配
c0103756:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010375d:	e8 b9 07 00 00       	call   c0103f1b <alloc_pages>
c0103762:	85 c0                	test   %eax,%eax
c0103764:	74 24                	je     c010378a <default_check+0x203>
c0103766:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c010376d:	c0 
c010376e:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103775:	c0 
c0103776:	c7 44 24 04 49 01 00 	movl   $0x149,0x4(%esp)
c010377d:	00 
c010377e:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103785:	e8 a9 d4 ff ff       	call   c0100c33 <__panic>

    unsigned int nr_free_store = nr_free;// 保存当前空闲页数
c010378a:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c010378f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;// 将空闲页数设为 0
c0103792:	c7 05 e8 ce 11 c0 00 	movl   $0x0,0xc011cee8
c0103799:	00 00 00 
// 释放 3 个页面并确保分配页面时没有足够的空闲页
    free_pages(p0 + 2, 3);
c010379c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010379f:	83 c0 28             	add    $0x28,%eax
c01037a2:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c01037a9:	00 
c01037aa:	89 04 24             	mov    %eax,(%esp)
c01037ad:	e8 a3 07 00 00       	call   c0103f55 <free_pages>
    assert(alloc_pages(4) == NULL);// 确保无法分配 4 个页面
c01037b2:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c01037b9:	e8 5d 07 00 00       	call   c0103f1b <alloc_pages>
c01037be:	85 c0                	test   %eax,%eax
c01037c0:	74 24                	je     c01037e6 <default_check+0x25f>
c01037c2:	c7 44 24 0c 1c 6a 10 	movl   $0xc0106a1c,0xc(%esp)
c01037c9:	c0 
c01037ca:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01037d1:	c0 
c01037d2:	c7 44 24 04 4f 01 00 	movl   $0x14f,0x4(%esp)
c01037d9:	00 
c01037da:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01037e1:	e8 4d d4 ff ff       	call   c0100c33 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);// 检查页面属性
c01037e6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01037e9:	83 c0 28             	add    $0x28,%eax
c01037ec:	83 c0 04             	add    $0x4,%eax
c01037ef:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
c01037f6:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01037f9:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01037fc:	8b 55 ac             	mov    -0x54(%ebp),%edx
c01037ff:	0f a3 10             	bt     %edx,(%eax)
c0103802:	19 c0                	sbb    %eax,%eax
c0103804:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
c0103807:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c010380b:	0f 95 c0             	setne  %al
c010380e:	0f b6 c0             	movzbl %al,%eax
c0103811:	85 c0                	test   %eax,%eax
c0103813:	74 0e                	je     c0103823 <default_check+0x29c>
c0103815:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103818:	83 c0 28             	add    $0x28,%eax
c010381b:	8b 40 08             	mov    0x8(%eax),%eax
c010381e:	83 f8 03             	cmp    $0x3,%eax
c0103821:	74 24                	je     c0103847 <default_check+0x2c0>
c0103823:	c7 44 24 0c 34 6a 10 	movl   $0xc0106a34,0xc(%esp)
c010382a:	c0 
c010382b:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103832:	c0 
c0103833:	c7 44 24 04 50 01 00 	movl   $0x150,0x4(%esp)
c010383a:	00 
c010383b:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103842:	e8 ec d3 ff ff       	call   c0100c33 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);// 再次分配 3 个页面
c0103847:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
c010384e:	e8 c8 06 00 00       	call   c0103f1b <alloc_pages>
c0103853:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103856:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010385a:	75 24                	jne    c0103880 <default_check+0x2f9>
c010385c:	c7 44 24 0c 60 6a 10 	movl   $0xc0106a60,0xc(%esp)
c0103863:	c0 
c0103864:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010386b:	c0 
c010386c:	c7 44 24 04 51 01 00 	movl   $0x151,0x4(%esp)
c0103873:	00 
c0103874:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c010387b:	e8 b3 d3 ff ff       	call   c0100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有页面可分配
c0103880:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103887:	e8 8f 06 00 00       	call   c0103f1b <alloc_pages>
c010388c:	85 c0                	test   %eax,%eax
c010388e:	74 24                	je     c01038b4 <default_check+0x32d>
c0103890:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c0103897:	c0 
c0103898:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c010389f:	c0 
c01038a0:	c7 44 24 04 52 01 00 	movl   $0x152,0x4(%esp)
c01038a7:	00 
c01038a8:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01038af:	e8 7f d3 ff ff       	call   c0100c33 <__panic>
    assert(p0 + 2 == p1);// 确保分配的页面是释放的页面
c01038b4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038b7:	83 c0 28             	add    $0x28,%eax
c01038ba:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c01038bd:	74 24                	je     c01038e3 <default_check+0x35c>
c01038bf:	c7 44 24 0c 7e 6a 10 	movl   $0xc0106a7e,0xc(%esp)
c01038c6:	c0 
c01038c7:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01038ce:	c0 
c01038cf:	c7 44 24 04 53 01 00 	movl   $0x153,0x4(%esp)
c01038d6:	00 
c01038d7:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01038de:	e8 50 d3 ff ff       	call   c0100c33 <__panic>

    p2 = p0 + 1; // 设置 p2 为 p0 的下一个页面
c01038e3:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038e6:	83 c0 14             	add    $0x14,%eax
c01038e9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);// 释放 p0 页面
c01038ec:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01038f3:	00 
c01038f4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01038f7:	89 04 24             	mov    %eax,(%esp)
c01038fa:	e8 56 06 00 00       	call   c0103f55 <free_pages>
    free_pages(p1, 3);// 释放 p1 指向的页面
c01038ff:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c0103906:	00 
c0103907:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010390a:	89 04 24             	mov    %eax,(%esp)
c010390d:	e8 43 06 00 00       	call   c0103f55 <free_pages>
    assert(PageProperty(p0) && p0->property == 1); // 检查 p0 属性
c0103912:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103915:	83 c0 04             	add    $0x4,%eax
c0103918:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c010391f:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0103922:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0103925:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0103928:	0f a3 10             	bt     %edx,(%eax)
c010392b:	19 c0                	sbb    %eax,%eax
c010392d:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
c0103930:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
c0103934:	0f 95 c0             	setne  %al
c0103937:	0f b6 c0             	movzbl %al,%eax
c010393a:	85 c0                	test   %eax,%eax
c010393c:	74 0b                	je     c0103949 <default_check+0x3c2>
c010393e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103941:	8b 40 08             	mov    0x8(%eax),%eax
c0103944:	83 f8 01             	cmp    $0x1,%eax
c0103947:	74 24                	je     c010396d <default_check+0x3e6>
c0103949:	c7 44 24 0c 8c 6a 10 	movl   $0xc0106a8c,0xc(%esp)
c0103950:	c0 
c0103951:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103958:	c0 
c0103959:	c7 44 24 04 58 01 00 	movl   $0x158,0x4(%esp)
c0103960:	00 
c0103961:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103968:	e8 c6 d2 ff ff       	call   c0100c33 <__panic>
    assert(PageProperty(p1) && p1->property == 3); // 检查 p1 属性
c010396d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103970:	83 c0 04             	add    $0x4,%eax
c0103973:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
c010397a:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010397d:	8b 45 90             	mov    -0x70(%ebp),%eax
c0103980:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0103983:	0f a3 10             	bt     %edx,(%eax)
c0103986:	19 c0                	sbb    %eax,%eax
c0103988:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
c010398b:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
c010398f:	0f 95 c0             	setne  %al
c0103992:	0f b6 c0             	movzbl %al,%eax
c0103995:	85 c0                	test   %eax,%eax
c0103997:	74 0b                	je     c01039a4 <default_check+0x41d>
c0103999:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010399c:	8b 40 08             	mov    0x8(%eax),%eax
c010399f:	83 f8 03             	cmp    $0x3,%eax
c01039a2:	74 24                	je     c01039c8 <default_check+0x441>
c01039a4:	c7 44 24 0c b4 6a 10 	movl   $0xc0106ab4,0xc(%esp)
c01039ab:	c0 
c01039ac:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01039b3:	c0 
c01039b4:	c7 44 24 04 59 01 00 	movl   $0x159,0x4(%esp)
c01039bb:	00 
c01039bc:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c01039c3:	e8 6b d2 ff ff       	call   c0100c33 <__panic>
// 确保重分配的页面是之前释放的页面
    assert((p0 = alloc_page()) == p2 - 1);
c01039c8:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01039cf:	e8 47 05 00 00       	call   c0103f1b <alloc_pages>
c01039d4:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01039d7:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01039da:	83 e8 14             	sub    $0x14,%eax
c01039dd:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01039e0:	74 24                	je     c0103a06 <default_check+0x47f>
c01039e2:	c7 44 24 0c da 6a 10 	movl   $0xc0106ada,0xc(%esp)
c01039e9:	c0 
c01039ea:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c01039f1:	c0 
c01039f2:	c7 44 24 04 5b 01 00 	movl   $0x15b,0x4(%esp)
c01039f9:	00 
c01039fa:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103a01:	e8 2d d2 ff ff       	call   c0100c33 <__panic>
    free_page(p0);// 释放分配的页面
c0103a06:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103a0d:	00 
c0103a0e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103a11:	89 04 24             	mov    %eax,(%esp)
c0103a14:	e8 3c 05 00 00       	call   c0103f55 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);// 分配 2 个页面并检查
c0103a19:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c0103a20:	e8 f6 04 00 00       	call   c0103f1b <alloc_pages>
c0103a25:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103a28:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103a2b:	83 c0 14             	add    $0x14,%eax
c0103a2e:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0103a31:	74 24                	je     c0103a57 <default_check+0x4d0>
c0103a33:	c7 44 24 0c f8 6a 10 	movl   $0xc0106af8,0xc(%esp)
c0103a3a:	c0 
c0103a3b:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103a42:	c0 
c0103a43:	c7 44 24 04 5d 01 00 	movl   $0x15d,0x4(%esp)
c0103a4a:	00 
c0103a4b:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103a52:	e8 dc d1 ff ff       	call   c0100c33 <__panic>
// 释放页面并检查空闲状态
    free_pages(p0, 2);
c0103a57:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c0103a5e:	00 
c0103a5f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103a62:	89 04 24             	mov    %eax,(%esp)
c0103a65:	e8 eb 04 00 00       	call   c0103f55 <free_pages>
    free_page(p2);
c0103a6a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103a71:	00 
c0103a72:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103a75:	89 04 24             	mov    %eax,(%esp)
c0103a78:	e8 d8 04 00 00       	call   c0103f55 <free_pages>
// 再次分配 5 个页面
    assert((p0 = alloc_pages(5)) != NULL);
c0103a7d:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0103a84:	e8 92 04 00 00       	call   c0103f1b <alloc_pages>
c0103a89:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103a8c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0103a90:	75 24                	jne    c0103ab6 <default_check+0x52f>
c0103a92:	c7 44 24 0c 18 6b 10 	movl   $0xc0106b18,0xc(%esp)
c0103a99:	c0 
c0103a9a:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103aa1:	c0 
c0103aa2:	c7 44 24 04 62 01 00 	movl   $0x162,0x4(%esp)
c0103aa9:	00 
c0103aaa:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103ab1:	e8 7d d1 ff ff       	call   c0100c33 <__panic>
    assert(alloc_page() == NULL);// 确保没有额外页面可分配
c0103ab6:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0103abd:	e8 59 04 00 00       	call   c0103f1b <alloc_pages>
c0103ac2:	85 c0                	test   %eax,%eax
c0103ac4:	74 24                	je     c0103aea <default_check+0x563>
c0103ac6:	c7 44 24 0c 76 69 10 	movl   $0xc0106976,0xc(%esp)
c0103acd:	c0 
c0103ace:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103ad5:	c0 
c0103ad6:	c7 44 24 04 63 01 00 	movl   $0x163,0x4(%esp)
c0103add:	00 
c0103ade:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103ae5:	e8 49 d1 ff ff       	call   c0100c33 <__panic>

    assert(nr_free == 0);// 确保空闲页数为 0
c0103aea:	a1 e8 ce 11 c0       	mov    0xc011cee8,%eax
c0103aef:	85 c0                	test   %eax,%eax
c0103af1:	74 24                	je     c0103b17 <default_check+0x590>
c0103af3:	c7 44 24 0c c9 69 10 	movl   $0xc01069c9,0xc(%esp)
c0103afa:	c0 
c0103afb:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103b02:	c0 
c0103b03:	c7 44 24 04 65 01 00 	movl   $0x165,0x4(%esp)
c0103b0a:	00 
c0103b0b:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103b12:	e8 1c d1 ff ff       	call   c0100c33 <__panic>
    nr_free = nr_free_store;// 恢复空闲页数
c0103b17:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103b1a:	a3 e8 ce 11 c0       	mov    %eax,0xc011cee8
// 恢复空闲列表状态
    free_list = free_list_store;
c0103b1f:	8b 45 80             	mov    -0x80(%ebp),%eax
c0103b22:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0103b25:	a3 e0 ce 11 c0       	mov    %eax,0xc011cee0
c0103b2a:	89 15 e4 ce 11 c0    	mov    %edx,0xc011cee4
    free_pages(p0, 5);// 释放所有分配的页面
c0103b30:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
c0103b37:	00 
c0103b38:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103b3b:	89 04 24             	mov    %eax,(%esp)
c0103b3e:	e8 12 04 00 00       	call   c0103f55 <free_pages>
    // 验证空闲列表的一致性
    le = &free_list;
c0103b43:	c7 45 ec e0 ce 11 c0 	movl   $0xc011cee0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0103b4a:	eb 1c                	jmp    c0103b68 <default_check+0x5e1>
        //assert(le->next->prev == le && le->prev->next == le);// 验证双向链表
        struct Page *p = le2page(le, page_link);// 更新计数和总属性值
c0103b4c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103b4f:	83 e8 0c             	sub    $0xc,%eax
c0103b52:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
c0103b55:	ff 4d f4             	decl   -0xc(%ebp)
c0103b58:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0103b5b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103b5e:	8b 48 08             	mov    0x8(%eax),%ecx
c0103b61:	89 d0                	mov    %edx,%eax
c0103b63:	29 c8                	sub    %ecx,%eax
c0103b65:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103b68:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103b6b:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
c0103b6e:	8b 45 88             	mov    -0x78(%ebp),%eax
c0103b71:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0103b74:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103b77:	81 7d ec e0 ce 11 c0 	cmpl   $0xc011cee0,-0x14(%ebp)
c0103b7e:	75 cc                	jne    c0103b4c <default_check+0x5c5>
    }
    assert(count == 0);// 确保所有页面都已处理
c0103b80:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0103b84:	74 24                	je     c0103baa <default_check+0x623>
c0103b86:	c7 44 24 0c 36 6b 10 	movl   $0xc0106b36,0xc(%esp)
c0103b8d:	c0 
c0103b8e:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103b95:	c0 
c0103b96:	c7 44 24 04 71 01 00 	movl   $0x171,0x4(%esp)
c0103b9d:	00 
c0103b9e:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103ba5:	e8 89 d0 ff ff       	call   c0100c33 <__panic>
    assert(total == 0);// 确保总属性值为 0
c0103baa:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0103bae:	74 24                	je     c0103bd4 <default_check+0x64d>
c0103bb0:	c7 44 24 0c 41 6b 10 	movl   $0xc0106b41,0xc(%esp)
c0103bb7:	c0 
c0103bb8:	c7 44 24 08 d6 67 10 	movl   $0xc01067d6,0x8(%esp)
c0103bbf:	c0 
c0103bc0:	c7 44 24 04 72 01 00 	movl   $0x172,0x4(%esp)
c0103bc7:	00 
c0103bc8:	c7 04 24 eb 67 10 c0 	movl   $0xc01067eb,(%esp)
c0103bcf:	e8 5f d0 ff ff       	call   c0100c33 <__panic>
}
c0103bd4:	90                   	nop
c0103bd5:	89 ec                	mov    %ebp,%esp
c0103bd7:	5d                   	pop    %ebp
c0103bd8:	c3                   	ret    

c0103bd9 <page2ppn>:
page2ppn(struct Page *page) {
c0103bd9:	55                   	push   %ebp
c0103bda:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0103bdc:	8b 15 00 cf 11 c0    	mov    0xc011cf00,%edx
c0103be2:	8b 45 08             	mov    0x8(%ebp),%eax
c0103be5:	29 d0                	sub    %edx,%eax
c0103be7:	c1 f8 02             	sar    $0x2,%eax
c0103bea:	69 c0 cd cc cc cc    	imul   $0xcccccccd,%eax,%eax
}
c0103bf0:	5d                   	pop    %ebp
c0103bf1:	c3                   	ret    

c0103bf2 <page2pa>:
page2pa(struct Page *page) {
c0103bf2:	55                   	push   %ebp
c0103bf3:	89 e5                	mov    %esp,%ebp
c0103bf5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0103bf8:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bfb:	89 04 24             	mov    %eax,(%esp)
c0103bfe:	e8 d6 ff ff ff       	call   c0103bd9 <page2ppn>
c0103c03:	c1 e0 0c             	shl    $0xc,%eax
}
c0103c06:	89 ec                	mov    %ebp,%esp
c0103c08:	5d                   	pop    %ebp
c0103c09:	c3                   	ret    

c0103c0a <pa2page>:
pa2page(uintptr_t pa) {
c0103c0a:	55                   	push   %ebp
c0103c0b:	89 e5                	mov    %esp,%ebp
c0103c0d:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
c0103c10:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c13:	c1 e8 0c             	shr    $0xc,%eax
c0103c16:	89 c2                	mov    %eax,%edx
c0103c18:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0103c1d:	39 c2                	cmp    %eax,%edx
c0103c1f:	72 1c                	jb     c0103c3d <pa2page+0x33>
        panic("pa2page called with invalid pa");
c0103c21:	c7 44 24 08 7c 6b 10 	movl   $0xc0106b7c,0x8(%esp)
c0103c28:	c0 
c0103c29:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
c0103c30:	00 
c0103c31:	c7 04 24 9b 6b 10 c0 	movl   $0xc0106b9b,(%esp)
c0103c38:	e8 f6 cf ff ff       	call   c0100c33 <__panic>
    return &pages[PPN(pa)];
c0103c3d:	8b 0d 00 cf 11 c0    	mov    0xc011cf00,%ecx
c0103c43:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c46:	c1 e8 0c             	shr    $0xc,%eax
c0103c49:	89 c2                	mov    %eax,%edx
c0103c4b:	89 d0                	mov    %edx,%eax
c0103c4d:	c1 e0 02             	shl    $0x2,%eax
c0103c50:	01 d0                	add    %edx,%eax
c0103c52:	c1 e0 02             	shl    $0x2,%eax
c0103c55:	01 c8                	add    %ecx,%eax
}
c0103c57:	89 ec                	mov    %ebp,%esp
c0103c59:	5d                   	pop    %ebp
c0103c5a:	c3                   	ret    

c0103c5b <page2kva>:
page2kva(struct Page *page) {
c0103c5b:	55                   	push   %ebp
c0103c5c:	89 e5                	mov    %esp,%ebp
c0103c5e:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
c0103c61:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c64:	89 04 24             	mov    %eax,(%esp)
c0103c67:	e8 86 ff ff ff       	call   c0103bf2 <page2pa>
c0103c6c:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0103c6f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103c72:	c1 e8 0c             	shr    $0xc,%eax
c0103c75:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103c78:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0103c7d:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0103c80:	72 23                	jb     c0103ca5 <page2kva+0x4a>
c0103c82:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103c85:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103c89:	c7 44 24 08 ac 6b 10 	movl   $0xc0106bac,0x8(%esp)
c0103c90:	c0 
c0103c91:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0103c98:	00 
c0103c99:	c7 04 24 9b 6b 10 c0 	movl   $0xc0106b9b,(%esp)
c0103ca0:	e8 8e cf ff ff       	call   c0100c33 <__panic>
c0103ca5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103ca8:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c0103cad:	89 ec                	mov    %ebp,%esp
c0103caf:	5d                   	pop    %ebp
c0103cb0:	c3                   	ret    

c0103cb1 <pte2page>:
pte2page(pte_t pte) {
c0103cb1:	55                   	push   %ebp
c0103cb2:	89 e5                	mov    %esp,%ebp
c0103cb4:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
c0103cb7:	8b 45 08             	mov    0x8(%ebp),%eax
c0103cba:	83 e0 01             	and    $0x1,%eax
c0103cbd:	85 c0                	test   %eax,%eax
c0103cbf:	75 1c                	jne    c0103cdd <pte2page+0x2c>
        panic("pte2page called with invalid pte");
c0103cc1:	c7 44 24 08 d0 6b 10 	movl   $0xc0106bd0,0x8(%esp)
c0103cc8:	c0 
c0103cc9:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
c0103cd0:	00 
c0103cd1:	c7 04 24 9b 6b 10 c0 	movl   $0xc0106b9b,(%esp)
c0103cd8:	e8 56 cf ff ff       	call   c0100c33 <__panic>
    return pa2page(PTE_ADDR(pte));
c0103cdd:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ce0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103ce5:	89 04 24             	mov    %eax,(%esp)
c0103ce8:	e8 1d ff ff ff       	call   c0103c0a <pa2page>
}
c0103ced:	89 ec                	mov    %ebp,%esp
c0103cef:	5d                   	pop    %ebp
c0103cf0:	c3                   	ret    

c0103cf1 <pde2page>:
pde2page(pde_t pde) {
c0103cf1:	55                   	push   %ebp
c0103cf2:	89 e5                	mov    %esp,%ebp
c0103cf4:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PDE_ADDR(pde));
c0103cf7:	8b 45 08             	mov    0x8(%ebp),%eax
c0103cfa:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103cff:	89 04 24             	mov    %eax,(%esp)
c0103d02:	e8 03 ff ff ff       	call   c0103c0a <pa2page>
}
c0103d07:	89 ec                	mov    %ebp,%esp
c0103d09:	5d                   	pop    %ebp
c0103d0a:	c3                   	ret    

c0103d0b <page_ref>:
page_ref(struct Page *page) {
c0103d0b:	55                   	push   %ebp
c0103d0c:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0103d0e:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d11:	8b 00                	mov    (%eax),%eax
}
c0103d13:	5d                   	pop    %ebp
c0103d14:	c3                   	ret    

c0103d15 <set_page_ref>:
set_page_ref(struct Page *page, int val) {
c0103d15:	55                   	push   %ebp
c0103d16:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0103d18:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d1b:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103d1e:	89 10                	mov    %edx,(%eax)
}
c0103d20:	90                   	nop
c0103d21:	5d                   	pop    %ebp
c0103d22:	c3                   	ret    

c0103d23 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c0103d23:	55                   	push   %ebp
c0103d24:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
c0103d26:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d29:	8b 00                	mov    (%eax),%eax
c0103d2b:	8d 50 01             	lea    0x1(%eax),%edx
c0103d2e:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d31:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103d33:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d36:	8b 00                	mov    (%eax),%eax
}
c0103d38:	5d                   	pop    %ebp
c0103d39:	c3                   	ret    

c0103d3a <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c0103d3a:	55                   	push   %ebp
c0103d3b:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
c0103d3d:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d40:	8b 00                	mov    (%eax),%eax
c0103d42:	8d 50 ff             	lea    -0x1(%eax),%edx
c0103d45:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d48:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103d4a:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d4d:	8b 00                	mov    (%eax),%eax
}
c0103d4f:	5d                   	pop    %ebp
c0103d50:	c3                   	ret    

c0103d51 <__intr_save>:
__intr_save(void) {
c0103d51:	55                   	push   %ebp
c0103d52:	89 e5                	mov    %esp,%ebp
c0103d54:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0103d57:	9c                   	pushf  
c0103d58:	58                   	pop    %eax
c0103d59:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0103d5c:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0103d5f:	25 00 02 00 00       	and    $0x200,%eax
c0103d64:	85 c0                	test   %eax,%eax
c0103d66:	74 0c                	je     c0103d74 <__intr_save+0x23>
        intr_disable();
c0103d68:	e8 1f d9 ff ff       	call   c010168c <intr_disable>
        return 1;
c0103d6d:	b8 01 00 00 00       	mov    $0x1,%eax
c0103d72:	eb 05                	jmp    c0103d79 <__intr_save+0x28>
    return 0;
c0103d74:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103d79:	89 ec                	mov    %ebp,%esp
c0103d7b:	5d                   	pop    %ebp
c0103d7c:	c3                   	ret    

c0103d7d <__intr_restore>:
__intr_restore(bool flag) {
c0103d7d:	55                   	push   %ebp
c0103d7e:	89 e5                	mov    %esp,%ebp
c0103d80:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0103d83:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0103d87:	74 05                	je     c0103d8e <__intr_restore+0x11>
        intr_enable();
c0103d89:	e8 f6 d8 ff ff       	call   c0101684 <intr_enable>
}
c0103d8e:	90                   	nop
c0103d8f:	89 ec                	mov    %ebp,%esp
c0103d91:	5d                   	pop    %ebp
c0103d92:	c3                   	ret    

c0103d93 <lgdt>:
 * data/code segement registers for kernel.
 * lgdt - 加载全局描述符表寄存器并重置内核的数据/代码段寄存器。
 * */
//定义了一个静态内联函数 lgdt，接收一个指向伪描述符（struct pseudodesc）的指针 pd
static inline void
lgdt(struct pseudodesc *pd) {
c0103d93:	55                   	push   %ebp
c0103d94:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));//这行汇编代码使用 lgdt 指令加载 GDT。%0 被替换为指向 pd 的指针，告诉处理器 GDT 的地址。
c0103d96:	8b 45 08             	mov    0x8(%ebp),%eax
c0103d99:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));//将 USER_DS（用户数据段）的值移动到 gs 段寄存器。
c0103d9c:	b8 23 00 00 00       	mov    $0x23,%eax
c0103da1:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));//将 USER_DS 的值移动到 fs 段寄存器。
c0103da3:	b8 23 00 00 00       	mov    $0x23,%eax
c0103da8:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));//将 KERNEL_DS（内核数据段）的值移动到 es 段寄存器。
c0103daa:	b8 10 00 00 00       	mov    $0x10,%eax
c0103daf:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));//将 KERNEL_DS 的值移动到 ds 段寄存器
c0103db1:	b8 10 00 00 00       	mov    $0x10,%eax
c0103db6:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));//将 KERNEL_DS 的值移动到 ss 段寄存器
c0103db8:	b8 10 00 00 00       	mov    $0x10,%eax
c0103dbd:	8e d0                	mov    %eax,%ss
    // reload cs
    //通过 ljmp 指令重新加载代码段寄存器 cs，并跳转到标签 1。
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c0103dbf:	ea c6 3d 10 c0 08 00 	ljmp   $0x8,$0xc0103dc6
}
c0103dc6:	90                   	nop
c0103dc7:	5d                   	pop    %ebp
c0103dc8:	c3                   	ret    

c0103dc9 <load_esp0>:
 *  load_esp0 - 修改默认任务状态段中的 ESP0，以便在从用户态陷入内核态时能够使用不同的内核栈。
 * */
//uintptr_t esp0：这是新的堆栈指针，通常指向内核栈的顶部。
//修改当前任务状态段（TSS）中的 ESP0 值。ESP0 是在从用户态切换到内核态时，CPU 使用的内核栈指针。
void
load_esp0(uintptr_t esp0) {
c0103dc9:	55                   	push   %ebp
c0103dca:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
c0103dcc:	8b 45 08             	mov    0x8(%ebp),%eax
c0103dcf:	a3 24 cf 11 c0       	mov    %eax,0xc011cf24
}
c0103dd4:	90                   	nop
c0103dd5:	5d                   	pop    %ebp
c0103dd6:	c3                   	ret    

c0103dd7 <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
/* gdt_init - 初始化默认的 GDT 和 TSS */
static void
gdt_init(void) {
c0103dd7:	55                   	push   %ebp
c0103dd8:	89 e5                	mov    %esp,%ebp
c0103dda:	83 ec 14             	sub    $0x14,%esp
    // 设置启动内核栈和默认的 SS0
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
c0103ddd:	b8 00 90 11 c0       	mov    $0xc0119000,%eax
c0103de2:	89 04 24             	mov    %eax,(%esp)
c0103de5:	e8 df ff ff ff       	call   c0103dc9 <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
c0103dea:	66 c7 05 28 cf 11 c0 	movw   $0x10,0xc011cf28
c0103df1:	10 00 
    // 初始化 GDT 中的 TSS 字段
    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
c0103df3:	66 c7 05 28 9a 11 c0 	movw   $0x68,0xc0119a28
c0103dfa:	68 00 
c0103dfc:	b8 20 cf 11 c0       	mov    $0xc011cf20,%eax
c0103e01:	0f b7 c0             	movzwl %ax,%eax
c0103e04:	66 a3 2a 9a 11 c0    	mov    %ax,0xc0119a2a
c0103e0a:	b8 20 cf 11 c0       	mov    $0xc011cf20,%eax
c0103e0f:	c1 e8 10             	shr    $0x10,%eax
c0103e12:	a2 2c 9a 11 c0       	mov    %al,0xc0119a2c
c0103e17:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103e1e:	24 f0                	and    $0xf0,%al
c0103e20:	0c 09                	or     $0x9,%al
c0103e22:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103e27:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103e2e:	24 ef                	and    $0xef,%al
c0103e30:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103e35:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103e3c:	24 9f                	and    $0x9f,%al
c0103e3e:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103e43:	0f b6 05 2d 9a 11 c0 	movzbl 0xc0119a2d,%eax
c0103e4a:	0c 80                	or     $0x80,%al
c0103e4c:	a2 2d 9a 11 c0       	mov    %al,0xc0119a2d
c0103e51:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103e58:	24 f0                	and    $0xf0,%al
c0103e5a:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103e5f:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103e66:	24 ef                	and    $0xef,%al
c0103e68:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103e6d:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103e74:	24 df                	and    $0xdf,%al
c0103e76:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103e7b:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103e82:	0c 40                	or     $0x40,%al
c0103e84:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103e89:	0f b6 05 2e 9a 11 c0 	movzbl 0xc0119a2e,%eax
c0103e90:	24 7f                	and    $0x7f,%al
c0103e92:	a2 2e 9a 11 c0       	mov    %al,0xc0119a2e
c0103e97:	b8 20 cf 11 c0       	mov    $0xc011cf20,%eax
c0103e9c:	c1 e8 18             	shr    $0x18,%eax
c0103e9f:	a2 2f 9a 11 c0       	mov    %al,0xc0119a2f
    // 使用lgdt加载全局描述符表，更新所有段寄存器
    // reload all segment registers
    lgdt(&gdt_pd);
c0103ea4:	c7 04 24 30 9a 11 c0 	movl   $0xc0119a30,(%esp)
c0103eab:	e8 e3 fe ff ff       	call   c0103d93 <lgdt>
c0103eb0:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
c0103eb6:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0103eba:	0f 00 d8             	ltr    %ax
}
c0103ebd:	90                   	nop
    // 加载 TSS，使 CPU 在进行特权级切换时能够正确使用 TSS。
    // load the TSS
    ltr(GD_TSS);
}
c0103ebe:	90                   	nop
c0103ebf:	89 ec                	mov    %ebp,%esp
c0103ec1:	5d                   	pop    %ebp
c0103ec2:	c3                   	ret    

c0103ec3 <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
//初始化一个 pmm_manager 实例
static void
init_pmm_manager(void) {
c0103ec3:	55                   	push   %ebp
c0103ec4:	89 e5                	mov    %esp,%ebp
c0103ec6:	83 ec 18             	sub    $0x18,%esp
    //将 pmm_manager 指向默认的 PMM 管理器实例。
    pmm_manager = &default_pmm_manager;
c0103ec9:	c7 05 0c cf 11 c0 60 	movl   $0xc0106b60,0xc011cf0c
c0103ed0:	6b 10 c0 
    //使用 cprintf 打印当前内存管理器的名称。
    cprintf("memory management: %s\n", pmm_manager->name);
c0103ed3:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103ed8:	8b 00                	mov    (%eax),%eax
c0103eda:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103ede:	c7 04 24 fc 6b 10 c0 	movl   $0xc0106bfc,(%esp)
c0103ee5:	e8 7c c4 ff ff       	call   c0100366 <cprintf>
    //调用 PMM 管理器的初始化函数，以设置和准备内存管理的相关数据结构。
    pmm_manager->init();
c0103eea:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103eef:	8b 40 04             	mov    0x4(%eax),%eax
c0103ef2:	ff d0                	call   *%eax
}
c0103ef4:	90                   	nop
c0103ef5:	89 ec                	mov    %ebp,%esp
c0103ef7:	5d                   	pop    %ebp
c0103ef8:	c3                   	ret    

c0103ef9 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
// init_memmap - 调用 pmm->init_memmap 构建空闲内存的 Page 结构
//struct Page *base：指向内存页的基础地址。 size_t n：要初始化的页数。
static void
init_memmap(struct Page *base, size_t n) {
c0103ef9:	55                   	push   %ebp
c0103efa:	89 e5                	mov    %esp,%ebp
c0103efc:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
c0103eff:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103f04:	8b 40 08             	mov    0x8(%eax),%eax
c0103f07:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103f0a:	89 54 24 04          	mov    %edx,0x4(%esp)
c0103f0e:	8b 55 08             	mov    0x8(%ebp),%edx
c0103f11:	89 14 24             	mov    %edx,(%esp)
c0103f14:	ff d0                	call   *%eax
}
c0103f16:	90                   	nop
c0103f17:	89 ec                	mov    %ebp,%esp
c0103f19:	5d                   	pop    %ebp
c0103f1a:	c3                   	ret    

c0103f1b <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
// alloc_pages - 调用 pmm->alloc_pages 分配连续的 n*PAGESIZE 内存
struct Page *
alloc_pages(size_t n) {
c0103f1b:	55                   	push   %ebp
c0103f1c:	89 e5                	mov    %esp,%ebp
c0103f1e:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
c0103f21:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    //使用 local_intr_save 保存当前的中断状态，以避免在分配内存时发生中断。
    local_intr_save(intr_flag);
c0103f28:	e8 24 fe ff ff       	call   c0103d51 <__intr_save>
c0103f2d:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        //调用物理内存管理器的 alloc_pages 函数分配 n 页的内存。
        page = pmm_manager->alloc_pages(n);
c0103f30:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103f35:	8b 40 0c             	mov    0xc(%eax),%eax
c0103f38:	8b 55 08             	mov    0x8(%ebp),%edx
c0103f3b:	89 14 24             	mov    %edx,(%esp)
c0103f3e:	ff d0                	call   *%eax
c0103f40:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    //恢复之前保存的中断状态。
    local_intr_restore(intr_flag);
c0103f43:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103f46:	89 04 24             	mov    %eax,(%esp)
c0103f49:	e8 2f fe ff ff       	call   c0103d7d <__intr_restore>
    return page;
c0103f4e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0103f51:	89 ec                	mov    %ebp,%esp
c0103f53:	5d                   	pop    %ebp
c0103f54:	c3                   	ret    

c0103f55 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
// free_pages - 调用 pmm->free_pages 释放连续的 n*PAGESIZE 内存
//struct Page *base：指向要释放的内存页的基础地址。size_t n：要释放的页数。
void
free_pages(struct Page *base, size_t n) {
c0103f55:	55                   	push   %ebp
c0103f56:	89 e5                	mov    %esp,%ebp
c0103f58:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    //使用 local_intr_save 保存当前的中断状态，以避免在释放内存时发生中断。
    local_intr_save(intr_flag);
c0103f5b:	e8 f1 fd ff ff       	call   c0103d51 <__intr_save>
c0103f60:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        //调用物理内存管理器的 free_pages 函数释放 n 页的内存。
        pmm_manager->free_pages(base, n);
c0103f63:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103f68:	8b 40 10             	mov    0x10(%eax),%eax
c0103f6b:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103f6e:	89 54 24 04          	mov    %edx,0x4(%esp)
c0103f72:	8b 55 08             	mov    0x8(%ebp),%edx
c0103f75:	89 14 24             	mov    %edx,(%esp)
c0103f78:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
c0103f7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103f7d:	89 04 24             	mov    %eax,(%esp)
c0103f80:	e8 f8 fd ff ff       	call   c0103d7d <__intr_restore>
}
c0103f85:	90                   	nop
c0103f86:	89 ec                	mov    %ebp,%esp
c0103f88:	5d                   	pop    %ebp
c0103f89:	c3                   	ret    

c0103f8a <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
// nr_free_pages - 调用 pmm->nr_free_pages 获取当前空闲内存的大小 (nr * PAGESIZE)
size_t
nr_free_pages(void) {
c0103f8a:	55                   	push   %ebp
c0103f8b:	89 e5                	mov    %esp,%ebp
c0103f8d:	83 ec 28             	sub    $0x28,%esp
    size_t ret;// 定义变量 ret 用于存储返回的空闲内存大小
    bool intr_flag;// 定义变量 intr_flag 用于保存中断状态
    local_intr_save(intr_flag);// 保存当前中断状态，并禁用中断
c0103f90:	e8 bc fd ff ff       	call   c0103d51 <__intr_save>
c0103f95:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();// 调用物理内存管理器的函数获取空闲内存页数
c0103f98:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0103f9d:	8b 40 14             	mov    0x14(%eax),%eax
c0103fa0:	ff d0                	call   *%eax
c0103fa2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);// 恢复之前保存的中断状态
c0103fa5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103fa8:	89 04 24             	mov    %eax,(%esp)
c0103fab:	e8 cd fd ff ff       	call   c0103d7d <__intr_restore>
    return ret;// 返回空闲内存的大小
c0103fb0:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0103fb3:	89 ec                	mov    %ebp,%esp
c0103fb5:	5d                   	pop    %ebp
c0103fb6:	c3                   	ret    

c0103fb7 <page_init>:

/* pmm_init - initialize the physical memory management */
/* pmm_init - 初始化物理内存管理 */
static void
page_init(void) {
c0103fb7:	55                   	push   %ebp
c0103fb8:	89 e5                	mov    %esp,%ebp
c0103fba:	57                   	push   %edi
c0103fbb:	56                   	push   %esi
c0103fbc:	53                   	push   %ebx
c0103fbd:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    // 获取物理内存映射信息，存于特定地址
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c0103fc3:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;// 初始化最大物理地址为0
c0103fca:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c0103fd1:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");// 打印“e820map”标题
c0103fd8:	c7 04 24 13 6c 10 c0 	movl   $0xc0106c13,(%esp)
c0103fdf:	e8 82 c3 ff ff       	call   c0100366 <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {// 遍历内存映射数组
c0103fe4:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0103feb:	e9 0c 01 00 00       	jmp    c01040fc <page_init+0x145>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size; // 获取每个区域的起始和结束地址
c0103ff0:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103ff3:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103ff6:	89 d0                	mov    %edx,%eax
c0103ff8:	c1 e0 02             	shl    $0x2,%eax
c0103ffb:	01 d0                	add    %edx,%eax
c0103ffd:	c1 e0 02             	shl    $0x2,%eax
c0104000:	01 c8                	add    %ecx,%eax
c0104002:	8b 50 08             	mov    0x8(%eax),%edx
c0104005:	8b 40 04             	mov    0x4(%eax),%eax
c0104008:	89 45 a0             	mov    %eax,-0x60(%ebp)
c010400b:	89 55 a4             	mov    %edx,-0x5c(%ebp)
c010400e:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104011:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104014:	89 d0                	mov    %edx,%eax
c0104016:	c1 e0 02             	shl    $0x2,%eax
c0104019:	01 d0                	add    %edx,%eax
c010401b:	c1 e0 02             	shl    $0x2,%eax
c010401e:	01 c8                	add    %ecx,%eax
c0104020:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104023:	8b 58 10             	mov    0x10(%eax),%ebx
c0104026:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104029:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c010402c:	01 c8                	add    %ecx,%eax
c010402e:	11 da                	adc    %ebx,%edx
c0104030:	89 45 98             	mov    %eax,-0x68(%ebp)
c0104033:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",// 打印内存区域的信息
c0104036:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104039:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010403c:	89 d0                	mov    %edx,%eax
c010403e:	c1 e0 02             	shl    $0x2,%eax
c0104041:	01 d0                	add    %edx,%eax
c0104043:	c1 e0 02             	shl    $0x2,%eax
c0104046:	01 c8                	add    %ecx,%eax
c0104048:	83 c0 14             	add    $0x14,%eax
c010404b:	8b 00                	mov    (%eax),%eax
c010404d:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
c0104053:	8b 45 98             	mov    -0x68(%ebp),%eax
c0104056:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0104059:	83 c0 ff             	add    $0xffffffff,%eax
c010405c:	83 d2 ff             	adc    $0xffffffff,%edx
c010405f:	89 c6                	mov    %eax,%esi
c0104061:	89 d7                	mov    %edx,%edi
c0104063:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104066:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104069:	89 d0                	mov    %edx,%eax
c010406b:	c1 e0 02             	shl    $0x2,%eax
c010406e:	01 d0                	add    %edx,%eax
c0104070:	c1 e0 02             	shl    $0x2,%eax
c0104073:	01 c8                	add    %ecx,%eax
c0104075:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104078:	8b 58 10             	mov    0x10(%eax),%ebx
c010407b:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
c0104081:	89 44 24 1c          	mov    %eax,0x1c(%esp)
c0104085:	89 74 24 14          	mov    %esi,0x14(%esp)
c0104089:	89 7c 24 18          	mov    %edi,0x18(%esp)
c010408d:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0104090:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0104093:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104097:	89 54 24 10          	mov    %edx,0x10(%esp)
c010409b:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c010409f:	89 5c 24 08          	mov    %ebx,0x8(%esp)
c01040a3:	c7 04 24 20 6c 10 c0 	movl   $0xc0106c20,(%esp)
c01040aa:	e8 b7 c2 ff ff       	call   c0100366 <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) { // 检查内存类型是否为可用内存
c01040af:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01040b2:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01040b5:	89 d0                	mov    %edx,%eax
c01040b7:	c1 e0 02             	shl    $0x2,%eax
c01040ba:	01 d0                	add    %edx,%eax
c01040bc:	c1 e0 02             	shl    $0x2,%eax
c01040bf:	01 c8                	add    %ecx,%eax
c01040c1:	83 c0 14             	add    $0x14,%eax
c01040c4:	8b 00                	mov    (%eax),%eax
c01040c6:	83 f8 01             	cmp    $0x1,%eax
c01040c9:	75 2e                	jne    c01040f9 <page_init+0x142>
            if (maxpa < end && begin < KMEMSIZE) {// 检查当前区域是否在有效范围内
c01040cb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01040ce:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01040d1:	3b 45 98             	cmp    -0x68(%ebp),%eax
c01040d4:	89 d0                	mov    %edx,%eax
c01040d6:	1b 45 9c             	sbb    -0x64(%ebp),%eax
c01040d9:	73 1e                	jae    c01040f9 <page_init+0x142>
c01040db:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
c01040e0:	b8 00 00 00 00       	mov    $0x0,%eax
c01040e5:	3b 55 a0             	cmp    -0x60(%ebp),%edx
c01040e8:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
c01040eb:	72 0c                	jb     c01040f9 <page_init+0x142>
                maxpa = end;// 更新最大物理地址
c01040ed:	8b 45 98             	mov    -0x68(%ebp),%eax
c01040f0:	8b 55 9c             	mov    -0x64(%ebp),%edx
c01040f3:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01040f6:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {// 遍历内存映射数组
c01040f9:	ff 45 dc             	incl   -0x24(%ebp)
c01040fc:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01040ff:	8b 00                	mov    (%eax),%eax
c0104101:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0104104:	0f 8c e6 fe ff ff    	jl     c0103ff0 <page_init+0x39>
            }
        }
    }
    if (maxpa > KMEMSIZE) {// 如果最大物理地址超过了预定义的内存上限
c010410a:	ba 00 00 00 38       	mov    $0x38000000,%edx
c010410f:	b8 00 00 00 00       	mov    $0x0,%eax
c0104114:	3b 55 e0             	cmp    -0x20(%ebp),%edx
c0104117:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
c010411a:	73 0e                	jae    c010412a <page_init+0x173>
        maxpa = KMEMSIZE;// 将其限制为内存上限
c010411c:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
c0104123:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];// 引入全局变量 end，指向内存的结束位置

    npage = maxpa / PGSIZE; // 计算可用页数
c010412a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010412d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104130:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104134:	c1 ea 0c             	shr    $0xc,%edx
c0104137:	a3 04 cf 11 c0       	mov    %eax,0xc011cf04
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);// 将 end 对齐到页边界，指向页结构数组的开头
c010413c:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
c0104143:	b8 8c cf 11 c0       	mov    $0xc011cf8c,%eax
c0104148:	8d 50 ff             	lea    -0x1(%eax),%edx
c010414b:	8b 45 c0             	mov    -0x40(%ebp),%eax
c010414e:	01 d0                	add    %edx,%eax
c0104150:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0104153:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0104156:	ba 00 00 00 00       	mov    $0x0,%edx
c010415b:	f7 75 c0             	divl   -0x40(%ebp)
c010415e:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0104161:	29 d0                	sub    %edx,%eax
c0104163:	a3 00 cf 11 c0       	mov    %eax,0xc011cf00

    for (i = 0; i < npage; i ++) {// 遍历每一页
c0104168:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c010416f:	eb 2f                	jmp    c01041a0 <page_init+0x1e9>
        SetPageReserved(pages + i);// 将每一页标记为保留状态
c0104171:	8b 0d 00 cf 11 c0    	mov    0xc011cf00,%ecx
c0104177:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010417a:	89 d0                	mov    %edx,%eax
c010417c:	c1 e0 02             	shl    $0x2,%eax
c010417f:	01 d0                	add    %edx,%eax
c0104181:	c1 e0 02             	shl    $0x2,%eax
c0104184:	01 c8                	add    %ecx,%eax
c0104186:	83 c0 04             	add    $0x4,%eax
c0104189:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
c0104190:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0104193:	8b 45 90             	mov    -0x70(%ebp),%eax
c0104196:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0104199:	0f ab 10             	bts    %edx,(%eax)
}
c010419c:	90                   	nop
    for (i = 0; i < npage; i ++) {// 遍历每一页
c010419d:	ff 45 dc             	incl   -0x24(%ebp)
c01041a0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01041a3:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c01041a8:	39 c2                	cmp    %eax,%edx
c01041aa:	72 c5                	jb     c0104171 <page_init+0x1ba>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);// 计算可用内存的起始地址
c01041ac:	8b 15 04 cf 11 c0    	mov    0xc011cf04,%edx
c01041b2:	89 d0                	mov    %edx,%eax
c01041b4:	c1 e0 02             	shl    $0x2,%eax
c01041b7:	01 d0                	add    %edx,%eax
c01041b9:	c1 e0 02             	shl    $0x2,%eax
c01041bc:	89 c2                	mov    %eax,%edx
c01041be:	a1 00 cf 11 c0       	mov    0xc011cf00,%eax
c01041c3:	01 d0                	add    %edx,%eax
c01041c5:	89 45 b8             	mov    %eax,-0x48(%ebp)
c01041c8:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
c01041cf:	77 23                	ja     c01041f4 <page_init+0x23d>
c01041d1:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01041d4:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01041d8:	c7 44 24 08 50 6c 10 	movl   $0xc0106c50,0x8(%esp)
c01041df:	c0 
c01041e0:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
c01041e7:	00 
c01041e8:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01041ef:	e8 3f ca ff ff       	call   c0100c33 <__panic>
c01041f4:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01041f7:	05 00 00 00 40       	add    $0x40000000,%eax
c01041fc:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {// 再次遍历内存映射
c01041ff:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0104206:	e9 53 01 00 00       	jmp    c010435e <page_init+0x3a7>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;// 获取每个区域的起始和结束地址
c010420b:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010420e:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104211:	89 d0                	mov    %edx,%eax
c0104213:	c1 e0 02             	shl    $0x2,%eax
c0104216:	01 d0                	add    %edx,%eax
c0104218:	c1 e0 02             	shl    $0x2,%eax
c010421b:	01 c8                	add    %ecx,%eax
c010421d:	8b 50 08             	mov    0x8(%eax),%edx
c0104220:	8b 40 04             	mov    0x4(%eax),%eax
c0104223:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104226:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0104229:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c010422c:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010422f:	89 d0                	mov    %edx,%eax
c0104231:	c1 e0 02             	shl    $0x2,%eax
c0104234:	01 d0                	add    %edx,%eax
c0104236:	c1 e0 02             	shl    $0x2,%eax
c0104239:	01 c8                	add    %ecx,%eax
c010423b:	8b 48 0c             	mov    0xc(%eax),%ecx
c010423e:	8b 58 10             	mov    0x10(%eax),%ebx
c0104241:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104244:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104247:	01 c8                	add    %ecx,%eax
c0104249:	11 da                	adc    %ebx,%edx
c010424b:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010424e:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {// 如果区域类型为可用内存
c0104251:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104254:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104257:	89 d0                	mov    %edx,%eax
c0104259:	c1 e0 02             	shl    $0x2,%eax
c010425c:	01 d0                	add    %edx,%eax
c010425e:	c1 e0 02             	shl    $0x2,%eax
c0104261:	01 c8                	add    %ecx,%eax
c0104263:	83 c0 14             	add    $0x14,%eax
c0104266:	8b 00                	mov    (%eax),%eax
c0104268:	83 f8 01             	cmp    $0x1,%eax
c010426b:	0f 85 ea 00 00 00    	jne    c010435b <page_init+0x3a4>
            if (begin < freemem) { // 如果起始地址小于可用内存地址
c0104271:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0104274:	ba 00 00 00 00       	mov    $0x0,%edx
c0104279:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c010427c:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c010427f:	19 d1                	sbb    %edx,%ecx
c0104281:	73 0d                	jae    c0104290 <page_init+0x2d9>
                begin = freemem;// 将起始地址设置为可用内存地址
c0104283:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0104286:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104289:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {// 如果结束地址超过内存上限
c0104290:	ba 00 00 00 38       	mov    $0x38000000,%edx
c0104295:	b8 00 00 00 00       	mov    $0x0,%eax
c010429a:	3b 55 c8             	cmp    -0x38(%ebp),%edx
c010429d:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01042a0:	73 0e                	jae    c01042b0 <page_init+0x2f9>
                end = KMEMSIZE;// 将其限制为内存上限
c01042a2:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c01042a9:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {// 如果起始地址小于结束地址
c01042b0:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01042b3:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01042b6:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c01042b9:	89 d0                	mov    %edx,%eax
c01042bb:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01042be:	0f 83 97 00 00 00    	jae    c010435b <page_init+0x3a4>
                begin = ROUNDUP(begin, PGSIZE);// 将起始地址对齐到页边界
c01042c4:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
c01042cb:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01042ce:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01042d1:	01 d0                	add    %edx,%eax
c01042d3:	48                   	dec    %eax
c01042d4:	89 45 ac             	mov    %eax,-0x54(%ebp)
c01042d7:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01042da:	ba 00 00 00 00       	mov    $0x0,%edx
c01042df:	f7 75 b0             	divl   -0x50(%ebp)
c01042e2:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01042e5:	29 d0                	sub    %edx,%eax
c01042e7:	ba 00 00 00 00       	mov    $0x0,%edx
c01042ec:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01042ef:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);// 将结束地址对齐到页边界
c01042f2:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01042f5:	89 45 a8             	mov    %eax,-0x58(%ebp)
c01042f8:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01042fb:	ba 00 00 00 00       	mov    $0x0,%edx
c0104300:	89 c7                	mov    %eax,%edi
c0104302:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
c0104308:	89 7d 80             	mov    %edi,-0x80(%ebp)
c010430b:	89 d0                	mov    %edx,%eax
c010430d:	83 e0 00             	and    $0x0,%eax
c0104310:	89 45 84             	mov    %eax,-0x7c(%ebp)
c0104313:	8b 45 80             	mov    -0x80(%ebp),%eax
c0104316:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0104319:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010431c:	89 55 cc             	mov    %edx,-0x34(%ebp)
                if (begin < end) {// 如果调整后的起始地址仍小于结束地址
c010431f:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104322:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0104325:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c0104328:	89 d0                	mov    %edx,%eax
c010432a:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c010432d:	73 2c                	jae    c010435b <page_init+0x3a4>
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);// 初始化内存页映射
c010432f:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104332:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0104335:	2b 45 d0             	sub    -0x30(%ebp),%eax
c0104338:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
c010433b:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c010433f:	c1 ea 0c             	shr    $0xc,%edx
c0104342:	89 c3                	mov    %eax,%ebx
c0104344:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104347:	89 04 24             	mov    %eax,(%esp)
c010434a:	e8 bb f8 ff ff       	call   c0103c0a <pa2page>
c010434f:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0104353:	89 04 24             	mov    %eax,(%esp)
c0104356:	e8 9e fb ff ff       	call   c0103ef9 <init_memmap>
    for (i = 0; i < memmap->nr_map; i ++) {// 再次遍历内存映射
c010435b:	ff 45 dc             	incl   -0x24(%ebp)
c010435e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0104361:	8b 00                	mov    (%eax),%eax
c0104363:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0104366:	0f 8c 9f fe ff ff    	jl     c010420b <page_init+0x254>
                }
            }
        }
    }
}
c010436c:	90                   	nop
c010436d:	90                   	nop
c010436e:	81 c4 9c 00 00 00    	add    $0x9c,%esp
c0104374:	5b                   	pop    %ebx
c0104375:	5e                   	pop    %esi
c0104376:	5f                   	pop    %edi
c0104377:	5d                   	pop    %ebp
c0104378:	c3                   	ret    

c0104379 <boot_map_segment>:
//la:   需要映射的线性地址（经过 x86 段映射后的地址）
//  size: memory size   size: 内存大小
//  pa:   physical address of this memory  pa:该内存的物理地址
//  perm: permission of this memory    perm: 该内存的权限
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c0104379:	55                   	push   %ebp
c010437a:	89 e5                	mov    %esp,%ebp
c010437c:	83 ec 38             	sub    $0x38,%esp
    // 确保线性地址和物理地址的页偏移相同
    assert(PGOFF(la) == PGOFF(pa));
c010437f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104382:	33 45 14             	xor    0x14(%ebp),%eax
c0104385:	25 ff 0f 00 00       	and    $0xfff,%eax
c010438a:	85 c0                	test   %eax,%eax
c010438c:	74 24                	je     c01043b2 <boot_map_segment+0x39>
c010438e:	c7 44 24 0c 82 6c 10 	movl   $0xc0106c82,0xc(%esp)
c0104395:	c0 
c0104396:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c010439d:	c0 
c010439e:	c7 44 24 04 2d 01 00 	movl   $0x12d,0x4(%esp)
c01043a5:	00 
c01043a6:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01043ad:	e8 81 c8 ff ff       	call   c0100c33 <__panic>
    // 计算需要映射的页数，ROUNDUP 将总大小对齐到下一个页大小的边界
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c01043b2:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
c01043b9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01043bc:	25 ff 0f 00 00       	and    $0xfff,%eax
c01043c1:	89 c2                	mov    %eax,%edx
c01043c3:	8b 45 10             	mov    0x10(%ebp),%eax
c01043c6:	01 c2                	add    %eax,%edx
c01043c8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01043cb:	01 d0                	add    %edx,%eax
c01043cd:	48                   	dec    %eax
c01043ce:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01043d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01043d4:	ba 00 00 00 00       	mov    $0x0,%edx
c01043d9:	f7 75 f0             	divl   -0x10(%ebp)
c01043dc:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01043df:	29 d0                	sub    %edx,%eax
c01043e1:	c1 e8 0c             	shr    $0xc,%eax
c01043e4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 将线性地址向下对齐到页边界
    la = ROUNDDOWN(la, PGSIZE);
c01043e7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01043ea:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01043ed:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01043f0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01043f5:	89 45 0c             	mov    %eax,0xc(%ebp)
    // 将物理地址向下对齐到页边界
    pa = ROUNDDOWN(pa, PGSIZE);
c01043f8:	8b 45 14             	mov    0x14(%ebp),%eax
c01043fb:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01043fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104401:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104406:	89 45 14             	mov    %eax,0x14(%ebp)
    // 循环遍历每一页，直到映射的页数为零
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104409:	eb 68                	jmp    c0104473 <boot_map_segment+0xfa>
        // 获取当前页的页表项指针，如果不存在则创建新的页表项
        pte_t *ptep = get_pte(pgdir, la, 1);
c010440b:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104412:	00 
c0104413:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104416:	89 44 24 04          	mov    %eax,0x4(%esp)
c010441a:	8b 45 08             	mov    0x8(%ebp),%eax
c010441d:	89 04 24             	mov    %eax,(%esp)
c0104420:	e8 88 01 00 00       	call   c01045ad <get_pte>
c0104425:	89 45 e0             	mov    %eax,-0x20(%ebp)
        // 确保页表项指针不为空
        assert(ptep != NULL);
c0104428:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010442c:	75 24                	jne    c0104452 <boot_map_segment+0xd9>
c010442e:	c7 44 24 0c ae 6c 10 	movl   $0xc0106cae,0xc(%esp)
c0104435:	c0 
c0104436:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c010443d:	c0 
c010443e:	c7 44 24 04 39 01 00 	movl   $0x139,0x4(%esp)
c0104445:	00 
c0104446:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c010444d:	e8 e1 c7 ff ff       	call   c0100c33 <__panic>
         // 设置页表项，包含物理地址、存在位和权限
        *ptep = pa | PTE_P | perm;
c0104452:	8b 45 14             	mov    0x14(%ebp),%eax
c0104455:	0b 45 18             	or     0x18(%ebp),%eax
c0104458:	83 c8 01             	or     $0x1,%eax
c010445b:	89 c2                	mov    %eax,%edx
c010445d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104460:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c0104462:	ff 4d f4             	decl   -0xc(%ebp)
c0104465:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c010446c:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c0104473:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104477:	75 92                	jne    c010440b <boot_map_segment+0x92>
    }
}
c0104479:	90                   	nop
c010447a:	90                   	nop
c010447b:	89 ec                	mov    %ebp,%esp
c010447d:	5d                   	pop    %ebp
c010447e:	c3                   	ret    

c010447f <boot_alloc_page>:
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
//boot_alloc_page - 使用 pmm->alloc_pages(1) 分配一页内存.返回值: 分配的页面的内核虚拟地址
//注意: 此函数用于获取页目录表(PDT)和页表(PT)的内存
static void *
boot_alloc_page(void) {
c010447f:	55                   	push   %ebp
c0104480:	89 e5                	mov    %esp,%ebp
c0104482:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();// 调用分配页面的函数
c0104485:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010448c:	e8 8a fa ff ff       	call   c0103f1b <alloc_pages>
c0104491:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {// 检查分配是否成功
c0104494:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104498:	75 1c                	jne    c01044b6 <boot_alloc_page+0x37>
        panic("boot_alloc_page failed.\n");// 如果分配失败，则触发异常
c010449a:	c7 44 24 08 bb 6c 10 	movl   $0xc0106cbb,0x8(%esp)
c01044a1:	c0 
c01044a2:	c7 44 24 04 48 01 00 	movl   $0x148,0x4(%esp)
c01044a9:	00 
c01044aa:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01044b1:	e8 7d c7 ff ff       	call   c0100c33 <__panic>
    }
    return page2kva(p);// 返回分配页面的内核虚拟地址
c01044b6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01044b9:	89 04 24             	mov    %eax,(%esp)
c01044bc:	e8 9a f7 ff ff       	call   c0103c5b <page2kva>
}
c01044c1:	89 ec                	mov    %ebp,%esp
c01044c3:	5d                   	pop    %ebp
c01044c4:	c3                   	ret    

c01044c5 <pmm_init>:
//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
//pmm_init - 设置物理内存管理器，构建页目录表(PDT)和页表(PT)，以设置分页机制
//           - 检查物理内存管理器和分页机制的正确性，打印页目录表和页表
void
pmm_init(void) {
c01044c5:	55                   	push   %ebp
c01044c6:	89 e5                	mov    %esp,%ebp
c01044c8:	83 ec 38             	sub    $0x38,%esp
    // We've already enabled paging
    // 我们已经启用了分页
    boot_cr3 = PADDR(boot_pgdir);
c01044cb:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01044d0:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01044d3:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01044da:	77 23                	ja     c01044ff <pmm_init+0x3a>
c01044dc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01044df:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01044e3:	c7 44 24 08 50 6c 10 	movl   $0xc0106c50,0x8(%esp)
c01044ea:	c0 
c01044eb:	c7 44 24 04 55 01 00 	movl   $0x155,0x4(%esp)
c01044f2:	00 
c01044f3:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01044fa:	e8 34 c7 ff ff       	call   c0100c33 <__panic>
c01044ff:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104502:	05 00 00 00 40       	add    $0x40000000,%eax
c0104507:	a3 08 cf 11 c0       	mov    %eax,0xc011cf08
     // 我们需要分配/释放物理内存（粒度为 4KB 或其他大小）。
    // 因此在 pmm.h 中定义了物理内存管理器的框架（struct pmm_manager）。
    // 首先，我们应该基于该框架初始化一个物理内存管理器(pmm)。
    // 然后 pmm 可以分配/释放物理内存。
    // 现在，first_fit/best_fit/worst_fit/buddy_system 的 pmm 都可用。
    init_pmm_manager();// 初始化物理内存管理器
c010450c:	e8 b2 f9 ff ff       	call   c0103ec3 <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    // 检测物理内存空间，保留已经使用的内存，
    // 然后使用 pmm->init_memmap 创建空闲页面列表
    page_init();// 初始化页面管理
c0104511:	e8 a1 fa ff ff       	call   c0103fb7 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    // 使用 pmm->check 验证 pmm 中分配/释放函数的正确性
    check_alloc_page();// 检查页面分配功能
c0104516:	e8 ed 03 00 00       	call   c0104908 <check_alloc_page>

    check_pgdir();// 检查页目录的状态
c010451b:	e8 09 04 00 00       	call   c0104929 <check_pgdir>

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    // 递归地将 boot_pgdir 插入到自身中
    // 在虚拟地址 VPT 处形成虚拟页表
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;// 设置页目录项，映射自身
c0104520:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104525:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104528:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010452f:	77 23                	ja     c0104554 <pmm_init+0x8f>
c0104531:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104534:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104538:	c7 44 24 08 50 6c 10 	movl   $0xc0106c50,0x8(%esp)
c010453f:	c0 
c0104540:	c7 44 24 04 75 01 00 	movl   $0x175,0x4(%esp)
c0104547:	00 
c0104548:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c010454f:	e8 df c6 ff ff       	call   c0100c33 <__panic>
c0104554:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104557:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
c010455d:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104562:	05 ac 0f 00 00       	add    $0xfac,%eax
c0104567:	83 ca 03             	or     $0x3,%edx
c010456a:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    // 将所有物理内存映射到线性内存，基地址为 KERNBASE
    // 线性地址 KERNBASE ~ KERNBASE + KMEMSIZE = 物理地址 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);// 映射物理内存
c010456c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104571:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
c0104578:	00 
c0104579:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104580:	00 
c0104581:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
c0104588:	38 
c0104589:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
c0104590:	c0 
c0104591:	89 04 24             	mov    %eax,(%esp)
c0104594:	e8 e0 fd ff ff       	call   c0104379 <boot_map_segment>
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    // 由于我们正在使用引导加载程序的 GDT，
    // 我们应该重新加载 GDT（第二次，也是最后一次），以获取用户段和 TSS
    // 映射虚拟地址 0 ~ 4G = 线性地址 0 ~ 4G
    // 然后在 TSS 中设置内核栈 (ss:esp)，在 gdt 中设置 TSS，加载 TSS
    gdt_init();// 初始化全局描述符表
c0104599:	e8 39 f8 ff ff       	call   c0103dd7 <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
     // 现在基本的虚拟内存映射（见 memlayout.h）已建立。
    // 检查基础虚拟内存映射的正确性。
    check_boot_pgdir(); // 检查页目录的正确性
c010459e:	e8 24 0a 00 00       	call   c0104fc7 <check_boot_pgdir>

    print_pgdir(); // 打印页目录表
c01045a3:	e8 a1 0e 00 00       	call   c0105449 <print_pgdir>

}
c01045a8:	90                   	nop
c01045a9:	89 ec                	mov    %ebp,%esp
c01045ab:	5d                   	pop    %ebp
c01045ac:	c3                   	ret    

c01045ad <get_pte>:
//  pgdir:  页目录的内核虚拟基地址
//  la:     需要映射的线性地址
//  create: 一个逻辑值，决定是否为页表分配一页
// 返回值：该 PTE 的内核虚拟地址
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c01045ad:	55                   	push   %ebp
c01045ae:	89 e5                	mov    %esp,%ebp
c01045b0:	83 ec 38             	sub    $0x38,%esp
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
    // (1) 找到页目录项
    pde_t *pdep = &pgdir[PDX(la)];// 使用 PDX 宏获取页目录索引
c01045b3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01045b6:	c1 e8 16             	shr    $0x16,%eax
c01045b9:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c01045c0:	8b 45 08             	mov    0x8(%ebp),%eax
c01045c3:	01 d0                	add    %edx,%eax
c01045c5:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // (2) 检查页目录项是否存在
    if (!(*pdep & PTE_P)) {// 如果页目录项的存在位 PTE_P 没有被设置
c01045c8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01045cb:	8b 00                	mov    (%eax),%eax
c01045cd:	83 e0 01             	and    $0x1,%eax
c01045d0:	85 c0                	test   %eax,%eax
c01045d2:	0f 85 af 00 00 00    	jne    c0104687 <get_pte+0xda>
        struct Page *page;// 声明一个指针，用于指向新分配的页面
        // 检查是否允许创建新页表，或者分配页表失败
        if (!create || (page = alloc_page()) == NULL) {// 如果不允许创建或分配失败
c01045d8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01045dc:	74 15                	je     c01045f3 <get_pte+0x46>
c01045de:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01045e5:	e8 31 f9 ff ff       	call   c0103f1b <alloc_pages>
c01045ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01045ed:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01045f1:	75 0a                	jne    c01045fd <get_pte+0x50>
            return NULL;// 返回 NULL，表示无法获取页表
c01045f3:	b8 00 00 00 00       	mov    $0x0,%eax
c01045f8:	e9 e7 00 00 00       	jmp    c01046e4 <get_pte+0x137>
        }
        // 设置新分配页面的引用计数为 1
        set_page_ref(page, 1);
c01045fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104604:	00 
c0104605:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104608:	89 04 24             	mov    %eax,(%esp)
c010460b:	e8 05 f7 ff ff       	call   c0103d15 <set_page_ref>
        uintptr_t pa = page2pa(page);// 获取新分配页面的物理地址
c0104610:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104613:	89 04 24             	mov    %eax,(%esp)
c0104616:	e8 d7 f5 ff ff       	call   c0103bf2 <page2pa>
c010461b:	89 45 ec             	mov    %eax,-0x14(%ebp)
        memset(KADDR(pa), 0, PGSIZE);// 清空新分配的页表内容，初始化为零
c010461e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104621:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104624:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0104627:	c1 e8 0c             	shr    $0xc,%eax
c010462a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c010462d:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0104632:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
c0104635:	72 23                	jb     c010465a <get_pte+0xad>
c0104637:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010463a:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010463e:	c7 44 24 08 ac 6b 10 	movl   $0xc0106bac,0x8(%esp)
c0104645:	c0 
c0104646:	c7 44 24 04 ce 01 00 	movl   $0x1ce,0x4(%esp)
c010464d:	00 
c010464e:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104655:	e8 d9 c5 ff ff       	call   c0100c33 <__panic>
c010465a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010465d:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104662:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104669:	00 
c010466a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104671:	00 
c0104672:	89 04 24             	mov    %eax,(%esp)
c0104675:	e8 d4 18 00 00       	call   c0105f4e <memset>
        // 更新页目录项，设置物理地址和权限位
        *pdep = pa | PTE_U | PTE_W | PTE_P;// 将物理地址和权限位（用户可访问、可写、有效）合并设置
c010467a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010467d:	83 c8 07             	or     $0x7,%eax
c0104680:	89 c2                	mov    %eax,%edx
c0104682:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104685:	89 10                	mov    %edx,(%eax)
    }
    // 返回指定线性地址 la 对应的页表项的内核虚拟地址
    return &((pte_t *)KADDR(PDE_ADDR(*pdep)))[PTX(la)];// 计算并返回页表项的指针
c0104687:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010468a:	8b 00                	mov    (%eax),%eax
c010468c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104691:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0104694:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104697:	c1 e8 0c             	shr    $0xc,%eax
c010469a:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010469d:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c01046a2:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c01046a5:	72 23                	jb     c01046ca <get_pte+0x11d>
c01046a7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01046aa:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01046ae:	c7 44 24 08 ac 6b 10 	movl   $0xc0106bac,0x8(%esp)
c01046b5:	c0 
c01046b6:	c7 44 24 04 d3 01 00 	movl   $0x1d3,0x4(%esp)
c01046bd:	00 
c01046be:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01046c5:	e8 69 c5 ff ff       	call   c0100c33 <__panic>
c01046ca:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01046cd:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01046d2:	89 c2                	mov    %eax,%edx
c01046d4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01046d7:	c1 e8 0c             	shr    $0xc,%eax
c01046da:	25 ff 03 00 00       	and    $0x3ff,%eax
c01046df:	c1 e0 02             	shl    $0x2,%eax
c01046e2:	01 d0                	add    %edx,%eax
}
c01046e4:	89 ec                	mov    %ebp,%esp
c01046e6:	5d                   	pop    %ebp
c01046e7:	c3                   	ret    

c01046e8 <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
// get_page - 获取与线性地址 la 相关的 Page 结构体，使用页目录 pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c01046e8:	55                   	push   %ebp
c01046e9:	89 e5                	mov    %esp,%ebp
c01046eb:	83 ec 28             	sub    $0x28,%esp
     // 调用 get_pte 函数获取对应线性地址 la 的页表项指针
    pte_t *ptep = get_pte(pgdir, la, 0);
c01046ee:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01046f5:	00 
c01046f6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01046f9:	89 44 24 04          	mov    %eax,0x4(%esp)
c01046fd:	8b 45 08             	mov    0x8(%ebp),%eax
c0104700:	89 04 24             	mov    %eax,(%esp)
c0104703:	e8 a5 fe ff ff       	call   c01045ad <get_pte>
c0104708:	89 45 f4             	mov    %eax,-0xc(%ebp)
    // 如果 ptep_store 指针不为 NULL，将 ptep 存储到 ptep_store 指向的位置
    if (ptep_store != NULL) {
c010470b:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c010470f:	74 08                	je     c0104719 <get_page+0x31>
        *ptep_store = ptep; // 存储当前页表项的指针
c0104711:	8b 45 10             	mov    0x10(%ebp),%eax
c0104714:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104717:	89 10                	mov    %edx,(%eax)
    }
    // 检查 ptep 是否有效以及页表项的存在位 PTE_P 是否被设置
    if (ptep != NULL && *ptep & PTE_P) {
c0104719:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010471d:	74 1b                	je     c010473a <get_page+0x52>
c010471f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104722:	8b 00                	mov    (%eax),%eax
c0104724:	83 e0 01             	and    $0x1,%eax
c0104727:	85 c0                	test   %eax,%eax
c0104729:	74 0f                	je     c010473a <get_page+0x52>
        // 返回与页表项对应的 Page 结构体
        return pte2page(*ptep);// 将页表项转换为对应的 Page 结构
c010472b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010472e:	8b 00                	mov    (%eax),%eax
c0104730:	89 04 24             	mov    %eax,(%esp)
c0104733:	e8 79 f5 ff ff       	call   c0103cb1 <pte2page>
c0104738:	eb 05                	jmp    c010473f <get_page+0x57>
    }
    // 如果未找到有效的页，返回 NULL
    return NULL;
c010473a:	b8 00 00 00 00       	mov    $0x0,%eax
}
c010473f:	89 ec                	mov    %ebp,%esp
c0104741:	5d                   	pop    %ebp
c0104742:	c3                   	ret    

c0104743 <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c0104743:	55                   	push   %ebp
c0104744:	89 e5                	mov    %esp,%ebp
c0104746:	83 ec 28             	sub    $0x28,%esp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
    if (*ptep & PTE_P) {
c0104749:	8b 45 10             	mov    0x10(%ebp),%eax
c010474c:	8b 00                	mov    (%eax),%eax
c010474e:	83 e0 01             	and    $0x1,%eax
c0104751:	85 c0                	test   %eax,%eax
c0104753:	74 4d                	je     c01047a2 <page_remove_pte+0x5f>
        struct Page *page = pte2page(*ptep);// 找到对应的物理页
c0104755:	8b 45 10             	mov    0x10(%ebp),%eax
c0104758:	8b 00                	mov    (%eax),%eax
c010475a:	89 04 24             	mov    %eax,(%esp)
c010475d:	e8 4f f5 ff ff       	call   c0103cb1 <pte2page>
c0104762:	89 45 f4             	mov    %eax,-0xc(%ebp)
        // 减少物理页的引用计数，如果引用计数为零，释放该物理页
        if (page_ref_dec(page) == 0) {
c0104765:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104768:	89 04 24             	mov    %eax,(%esp)
c010476b:	e8 ca f5 ff ff       	call   c0103d3a <page_ref_dec>
c0104770:	85 c0                	test   %eax,%eax
c0104772:	75 13                	jne    c0104787 <page_remove_pte+0x44>
            free_page(page);
c0104774:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010477b:	00 
c010477c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010477f:	89 04 24             	mov    %eax,(%esp)
c0104782:	e8 ce f7 ff ff       	call   c0103f55 <free_pages>
        }
        *ptep = 0;// 清除页表项
c0104787:	8b 45 10             	mov    0x10(%ebp),%eax
c010478a:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        tlb_invalidate(pgdir, la);// 刷新 TLB
c0104790:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104793:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104797:	8b 45 08             	mov    0x8(%ebp),%eax
c010479a:	89 04 24             	mov    %eax,(%esp)
c010479d:	e8 07 01 00 00       	call   c01048a9 <tlb_invalidate>
    }
}
c01047a2:	90                   	nop
c01047a3:	89 ec                	mov    %ebp,%esp
c01047a5:	5d                   	pop    %ebp
c01047a6:	c3                   	ret    

c01047a7 <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
//移除一个虚拟地址对应的页面
void
page_remove(pde_t *pgdir, uintptr_t la) {
c01047a7:	55                   	push   %ebp
c01047a8:	89 e5                	mov    %esp,%ebp
c01047aa:	83 ec 28             	sub    $0x28,%esp
    //调用 get_pte 函数获取给定虚拟地址 la 对应的页表项指针 ptep。
    pte_t *ptep = get_pte(pgdir, la, 0);
c01047ad:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01047b4:	00 
c01047b5:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047b8:	89 44 24 04          	mov    %eax,0x4(%esp)
c01047bc:	8b 45 08             	mov    0x8(%ebp),%eax
c01047bf:	89 04 24             	mov    %eax,(%esp)
c01047c2:	e8 e6 fd ff ff       	call   c01045ad <get_pte>
c01047c7:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //如果 ptep 不为 NULL，则调用 page_remove_pte 函数移除该页表项。
    if (ptep != NULL) {
c01047ca:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01047ce:	74 19                	je     c01047e9 <page_remove+0x42>
        page_remove_pte(pgdir, la, ptep);
c01047d0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047d3:	89 44 24 08          	mov    %eax,0x8(%esp)
c01047d7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047da:	89 44 24 04          	mov    %eax,0x4(%esp)
c01047de:	8b 45 08             	mov    0x8(%ebp),%eax
c01047e1:	89 04 24             	mov    %eax,(%esp)
c01047e4:	e8 5a ff ff ff       	call   c0104743 <page_remove_pte>
    }
}
c01047e9:	90                   	nop
c01047ea:	89 ec                	mov    %ebp,%esp
c01047ec:	5d                   	pop    %ebp
c01047ed:	c3                   	ret    

c01047ee <page_insert>:
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
//将一个页面插入到页表中。
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c01047ee:	55                   	push   %ebp
c01047ef:	89 e5                	mov    %esp,%ebp
c01047f1:	83 ec 28             	sub    $0x28,%esp
    //通过 get_pte 函数获取指定虚拟地址 la 对应的页表项指针 ptep。
    pte_t *ptep = get_pte(pgdir, la, 1);
c01047f4:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c01047fb:	00 
c01047fc:	8b 45 10             	mov    0x10(%ebp),%eax
c01047ff:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104803:	8b 45 08             	mov    0x8(%ebp),%eax
c0104806:	89 04 24             	mov    %eax,(%esp)
c0104809:	e8 9f fd ff ff       	call   c01045ad <get_pte>
c010480e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //如果 ptep 为 NULL，表示内存分配失败，返回 -E_NO_MEM。
    if (ptep == NULL) {
c0104811:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104815:	75 0a                	jne    c0104821 <page_insert+0x33>
        return -E_NO_MEM;
c0104817:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c010481c:	e9 84 00 00 00       	jmp    c01048a5 <page_insert+0xb7>
    }
    //调用 page_ref_inc 增加页面的引用计数。
    page_ref_inc(page);
c0104821:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104824:	89 04 24             	mov    %eax,(%esp)
c0104827:	e8 f7 f4 ff ff       	call   c0103d23 <page_ref_inc>
    //如果页表项已存在且指向当前页面，则减少页面引用计数。
    if (*ptep & PTE_P) {
c010482c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010482f:	8b 00                	mov    (%eax),%eax
c0104831:	83 e0 01             	and    $0x1,%eax
c0104834:	85 c0                	test   %eax,%eax
c0104836:	74 3e                	je     c0104876 <page_insert+0x88>
        struct Page *p = pte2page(*ptep);
c0104838:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010483b:	8b 00                	mov    (%eax),%eax
c010483d:	89 04 24             	mov    %eax,(%esp)
c0104840:	e8 6c f4 ff ff       	call   c0103cb1 <pte2page>
c0104845:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
c0104848:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010484b:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010484e:	75 0d                	jne    c010485d <page_insert+0x6f>
            page_ref_dec(page);
c0104850:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104853:	89 04 24             	mov    %eax,(%esp)
c0104856:	e8 df f4 ff ff       	call   c0103d3a <page_ref_dec>
c010485b:	eb 19                	jmp    c0104876 <page_insert+0x88>
        }
        //如果页表项已存在但指向其他页面，则调用 page_remove_pte 移除旧的页表项。
        else {
            page_remove_pte(pgdir, la, ptep);
c010485d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104860:	89 44 24 08          	mov    %eax,0x8(%esp)
c0104864:	8b 45 10             	mov    0x10(%ebp),%eax
c0104867:	89 44 24 04          	mov    %eax,0x4(%esp)
c010486b:	8b 45 08             	mov    0x8(%ebp),%eax
c010486e:	89 04 24             	mov    %eax,(%esp)
c0104871:	e8 cd fe ff ff       	call   c0104743 <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
c0104876:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104879:	89 04 24             	mov    %eax,(%esp)
c010487c:	e8 71 f3 ff ff       	call   c0103bf2 <page2pa>
c0104881:	0b 45 14             	or     0x14(%ebp),%eax
c0104884:	83 c8 01             	or     $0x1,%eax
c0104887:	89 c2                	mov    %eax,%edx
c0104889:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010488c:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);//刷新 TLB
c010488e:	8b 45 10             	mov    0x10(%ebp),%eax
c0104891:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104895:	8b 45 08             	mov    0x8(%ebp),%eax
c0104898:	89 04 24             	mov    %eax,(%esp)
c010489b:	e8 09 00 00 00       	call   c01048a9 <tlb_invalidate>
    return 0;
c01048a0:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01048a5:	89 ec                	mov    %ebp,%esp
c01048a7:	5d                   	pop    %ebp
c01048a8:	c3                   	ret    

c01048a9 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
//无效化指定地址的TLB条目
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c01048a9:	55                   	push   %ebp
c01048aa:	89 e5                	mov    %esp,%ebp
c01048ac:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
c01048af:	0f 20 d8             	mov    %cr3,%eax
c01048b2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
c01048b5:	8b 55 f0             	mov    -0x10(%ebp),%edx
    //检查当前页目录地址是否与传入的页目录地址相同。
    if (rcr3() == PADDR(pgdir)) {
c01048b8:	8b 45 08             	mov    0x8(%ebp),%eax
c01048bb:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01048be:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01048c5:	77 23                	ja     c01048ea <tlb_invalidate+0x41>
c01048c7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01048ca:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01048ce:	c7 44 24 08 50 6c 10 	movl   $0xc0106c50,0x8(%esp)
c01048d5:	c0 
c01048d6:	c7 44 24 04 47 02 00 	movl   $0x247,0x4(%esp)
c01048dd:	00 
c01048de:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01048e5:	e8 49 c3 ff ff       	call   c0100c33 <__panic>
c01048ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01048ed:	05 00 00 00 40       	add    $0x40000000,%eax
c01048f2:	39 d0                	cmp    %edx,%eax
c01048f4:	75 0d                	jne    c0104903 <tlb_invalidate+0x5a>
        //如果相同，则调用 invlpg 函数无效化指定线性地址的TLB条目。
        invlpg((void *)la);
c01048f6:	8b 45 0c             	mov    0xc(%ebp),%eax
c01048f9:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c01048fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01048ff:	0f 01 38             	invlpg (%eax)
}
c0104902:	90                   	nop
    }
}
c0104903:	90                   	nop
c0104904:	89 ec                	mov    %ebp,%esp
c0104906:	5d                   	pop    %ebp
c0104907:	c3                   	ret    

c0104908 <check_alloc_page>:

static void
check_alloc_page(void) {
c0104908:	55                   	push   %ebp
c0104909:	89 e5                	mov    %esp,%ebp
c010490b:	83 ec 18             	sub    $0x18,%esp
    //调用内存管理器的 check 方法，用于检查内存分配是否正常。
    pmm_manager->check();
c010490e:	a1 0c cf 11 c0       	mov    0xc011cf0c,%eax
c0104913:	8b 40 18             	mov    0x18(%eax),%eax
c0104916:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
c0104918:	c7 04 24 d4 6c 10 c0 	movl   $0xc0106cd4,(%esp)
c010491f:	e8 42 ba ff ff       	call   c0100366 <cprintf>
}
c0104924:	90                   	nop
c0104925:	89 ec                	mov    %ebp,%esp
c0104927:	5d                   	pop    %ebp
c0104928:	c3                   	ret    

c0104929 <check_pgdir>:
//用于验证页目录和页表的正确性。
static void
check_pgdir(void) {
c0104929:	55                   	push   %ebp
c010492a:	89 e5                	mov    %esp,%ebp
c010492c:	83 ec 38             	sub    $0x38,%esp
    //确保内存页面数量在合理范围内
    assert(npage <= KMEMSIZE / PGSIZE);
c010492f:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0104934:	3d 00 80 03 00       	cmp    $0x38000,%eax
c0104939:	76 24                	jbe    c010495f <check_pgdir+0x36>
c010493b:	c7 44 24 0c f3 6c 10 	movl   $0xc0106cf3,0xc(%esp)
c0104942:	c0 
c0104943:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c010494a:	c0 
c010494b:	c7 44 24 04 57 02 00 	movl   $0x257,0x4(%esp)
c0104952:	00 
c0104953:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c010495a:	e8 d4 c2 ff ff       	call   c0100c33 <__panic>
    //确保页目录不为空且对齐，
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c010495f:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104964:	85 c0                	test   %eax,%eax
c0104966:	74 0e                	je     c0104976 <check_pgdir+0x4d>
c0104968:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010496d:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104972:	85 c0                	test   %eax,%eax
c0104974:	74 24                	je     c010499a <check_pgdir+0x71>
c0104976:	c7 44 24 0c 10 6d 10 	movl   $0xc0106d10,0xc(%esp)
c010497d:	c0 
c010497e:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104985:	c0 
c0104986:	c7 44 24 04 59 02 00 	movl   $0x259,0x4(%esp)
c010498d:	00 
c010498e:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104995:	e8 99 c2 ff ff       	call   c0100c33 <__panic>
    //确保虚拟地址 0x0 没有映射任何页面
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c010499a:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010499f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01049a6:	00 
c01049a7:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01049ae:	00 
c01049af:	89 04 24             	mov    %eax,(%esp)
c01049b2:	e8 31 fd ff ff       	call   c01046e8 <get_page>
c01049b7:	85 c0                	test   %eax,%eax
c01049b9:	74 24                	je     c01049df <check_pgdir+0xb6>
c01049bb:	c7 44 24 0c 48 6d 10 	movl   $0xc0106d48,0xc(%esp)
c01049c2:	c0 
c01049c3:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c01049ca:	c0 
c01049cb:	c7 44 24 04 5b 02 00 	movl   $0x25b,0x4(%esp)
c01049d2:	00 
c01049d3:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01049da:	e8 54 c2 ff ff       	call   c0100c33 <__panic>
    
    //定义两个页面指针 p1 和 p2
    struct Page *p1, *p2;
    //分配一个页面 p1
    p1 = alloc_page();
c01049df:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01049e6:	e8 30 f5 ff ff       	call   c0103f1b <alloc_pages>
c01049eb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    //将 p1 插入到虚拟地址 0x0
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c01049ee:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01049f3:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c01049fa:	00 
c01049fb:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104a02:	00 
c0104a03:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104a06:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104a0a:	89 04 24             	mov    %eax,(%esp)
c0104a0d:	e8 dc fd ff ff       	call   c01047ee <page_insert>
c0104a12:	85 c0                	test   %eax,%eax
c0104a14:	74 24                	je     c0104a3a <check_pgdir+0x111>
c0104a16:	c7 44 24 0c 70 6d 10 	movl   $0xc0106d70,0xc(%esp)
c0104a1d:	c0 
c0104a1e:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104a25:	c0 
c0104a26:	c7 44 24 04 62 02 00 	movl   $0x262,0x4(%esp)
c0104a2d:	00 
c0104a2e:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104a35:	e8 f9 c1 ff ff       	call   c0100c33 <__panic>

    // 获取虚拟地址 0x0 对应的页表项指针
    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c0104a3a:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104a3f:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104a46:	00 
c0104a47:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104a4e:	00 
c0104a4f:	89 04 24             	mov    %eax,(%esp)
c0104a52:	e8 56 fb ff ff       	call   c01045ad <get_pte>
c0104a57:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104a5a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104a5e:	75 24                	jne    c0104a84 <check_pgdir+0x15b>
c0104a60:	c7 44 24 0c 9c 6d 10 	movl   $0xc0106d9c,0xc(%esp)
c0104a67:	c0 
c0104a68:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104a6f:	c0 
c0104a70:	c7 44 24 04 66 02 00 	movl   $0x266,0x4(%esp)
c0104a77:	00 
c0104a78:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104a7f:	e8 af c1 ff ff       	call   c0100c33 <__panic>
    // 验证页表项对应的页面是 p1
    assert(pte2page(*ptep) == p1);
c0104a84:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104a87:	8b 00                	mov    (%eax),%eax
c0104a89:	89 04 24             	mov    %eax,(%esp)
c0104a8c:	e8 20 f2 ff ff       	call   c0103cb1 <pte2page>
c0104a91:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104a94:	74 24                	je     c0104aba <check_pgdir+0x191>
c0104a96:	c7 44 24 0c c9 6d 10 	movl   $0xc0106dc9,0xc(%esp)
c0104a9d:	c0 
c0104a9e:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104aa5:	c0 
c0104aa6:	c7 44 24 04 68 02 00 	movl   $0x268,0x4(%esp)
c0104aad:	00 
c0104aae:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104ab5:	e8 79 c1 ff ff       	call   c0100c33 <__panic>
    // 验证 p1 的引用计数为 1
    assert(page_ref(p1) == 1);
c0104aba:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104abd:	89 04 24             	mov    %eax,(%esp)
c0104ac0:	e8 46 f2 ff ff       	call   c0103d0b <page_ref>
c0104ac5:	83 f8 01             	cmp    $0x1,%eax
c0104ac8:	74 24                	je     c0104aee <check_pgdir+0x1c5>
c0104aca:	c7 44 24 0c df 6d 10 	movl   $0xc0106ddf,0xc(%esp)
c0104ad1:	c0 
c0104ad2:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104ad9:	c0 
c0104ada:	c7 44 24 04 6a 02 00 	movl   $0x26a,0x4(%esp)
c0104ae1:	00 
c0104ae2:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104ae9:	e8 45 c1 ff ff       	call   c0100c33 <__panic>
    // 获取虚拟地址 PGSIZE 对应的页表项指针
    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
c0104aee:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104af3:	8b 00                	mov    (%eax),%eax
c0104af5:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104afa:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104afd:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104b00:	c1 e8 0c             	shr    $0xc,%eax
c0104b03:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104b06:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0104b0b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0104b0e:	72 23                	jb     c0104b33 <check_pgdir+0x20a>
c0104b10:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104b13:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104b17:	c7 44 24 08 ac 6b 10 	movl   $0xc0106bac,0x8(%esp)
c0104b1e:	c0 
c0104b1f:	c7 44 24 04 6c 02 00 	movl   $0x26c,0x4(%esp)
c0104b26:	00 
c0104b27:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104b2e:	e8 00 c1 ff ff       	call   c0100c33 <__panic>
c0104b33:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104b36:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104b3b:	83 c0 04             	add    $0x4,%eax
c0104b3e:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c0104b41:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104b46:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104b4d:	00 
c0104b4e:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104b55:	00 
c0104b56:	89 04 24             	mov    %eax,(%esp)
c0104b59:	e8 4f fa ff ff       	call   c01045ad <get_pte>
c0104b5e:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0104b61:	74 24                	je     c0104b87 <check_pgdir+0x25e>
c0104b63:	c7 44 24 0c f4 6d 10 	movl   $0xc0106df4,0xc(%esp)
c0104b6a:	c0 
c0104b6b:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104b72:	c0 
c0104b73:	c7 44 24 04 6d 02 00 	movl   $0x26d,0x4(%esp)
c0104b7a:	00 
c0104b7b:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104b82:	e8 ac c0 ff ff       	call   c0100c33 <__panic>
    // 分配一个页面 p2
    p2 = alloc_page();
c0104b87:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104b8e:	e8 88 f3 ff ff       	call   c0103f1b <alloc_pages>
c0104b93:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    // 将 p2 插入到虚拟地址 PGSIZE，并设置用户和写权限
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0104b96:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104b9b:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
c0104ba2:	00 
c0104ba3:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104baa:	00 
c0104bab:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104bae:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104bb2:	89 04 24             	mov    %eax,(%esp)
c0104bb5:	e8 34 fc ff ff       	call   c01047ee <page_insert>
c0104bba:	85 c0                	test   %eax,%eax
c0104bbc:	74 24                	je     c0104be2 <check_pgdir+0x2b9>
c0104bbe:	c7 44 24 0c 1c 6e 10 	movl   $0xc0106e1c,0xc(%esp)
c0104bc5:	c0 
c0104bc6:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104bcd:	c0 
c0104bce:	c7 44 24 04 71 02 00 	movl   $0x271,0x4(%esp)
c0104bd5:	00 
c0104bd6:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104bdd:	e8 51 c0 ff ff       	call   c0100c33 <__panic>
    // 获取虚拟地址 PGSIZE 对应的页表项指针
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104be2:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104be7:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104bee:	00 
c0104bef:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104bf6:	00 
c0104bf7:	89 04 24             	mov    %eax,(%esp)
c0104bfa:	e8 ae f9 ff ff       	call   c01045ad <get_pte>
c0104bff:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104c02:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104c06:	75 24                	jne    c0104c2c <check_pgdir+0x303>
c0104c08:	c7 44 24 0c 54 6e 10 	movl   $0xc0106e54,0xc(%esp)
c0104c0f:	c0 
c0104c10:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104c17:	c0 
c0104c18:	c7 44 24 04 73 02 00 	movl   $0x273,0x4(%esp)
c0104c1f:	00 
c0104c20:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104c27:	e8 07 c0 ff ff       	call   c0100c33 <__panic>
    // 验证页表项设置了用户权限
    assert(*ptep & PTE_U);
c0104c2c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104c2f:	8b 00                	mov    (%eax),%eax
c0104c31:	83 e0 04             	and    $0x4,%eax
c0104c34:	85 c0                	test   %eax,%eax
c0104c36:	75 24                	jne    c0104c5c <check_pgdir+0x333>
c0104c38:	c7 44 24 0c 84 6e 10 	movl   $0xc0106e84,0xc(%esp)
c0104c3f:	c0 
c0104c40:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104c47:	c0 
c0104c48:	c7 44 24 04 75 02 00 	movl   $0x275,0x4(%esp)
c0104c4f:	00 
c0104c50:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104c57:	e8 d7 bf ff ff       	call   c0100c33 <__panic>
    // 验证页表项设置了写权限
    assert(*ptep & PTE_W);
c0104c5c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104c5f:	8b 00                	mov    (%eax),%eax
c0104c61:	83 e0 02             	and    $0x2,%eax
c0104c64:	85 c0                	test   %eax,%eax
c0104c66:	75 24                	jne    c0104c8c <check_pgdir+0x363>
c0104c68:	c7 44 24 0c 92 6e 10 	movl   $0xc0106e92,0xc(%esp)
c0104c6f:	c0 
c0104c70:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104c77:	c0 
c0104c78:	c7 44 24 04 77 02 00 	movl   $0x277,0x4(%esp)
c0104c7f:	00 
c0104c80:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104c87:	e8 a7 bf ff ff       	call   c0100c33 <__panic>
    // 验证页目录项设置了用户权限
    assert(boot_pgdir[0] & PTE_U);
c0104c8c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104c91:	8b 00                	mov    (%eax),%eax
c0104c93:	83 e0 04             	and    $0x4,%eax
c0104c96:	85 c0                	test   %eax,%eax
c0104c98:	75 24                	jne    c0104cbe <check_pgdir+0x395>
c0104c9a:	c7 44 24 0c a0 6e 10 	movl   $0xc0106ea0,0xc(%esp)
c0104ca1:	c0 
c0104ca2:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104ca9:	c0 
c0104caa:	c7 44 24 04 79 02 00 	movl   $0x279,0x4(%esp)
c0104cb1:	00 
c0104cb2:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104cb9:	e8 75 bf ff ff       	call   c0100c33 <__panic>
    // 验证 p2 的引用计数为 1
    assert(page_ref(p2) == 1);
c0104cbe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104cc1:	89 04 24             	mov    %eax,(%esp)
c0104cc4:	e8 42 f0 ff ff       	call   c0103d0b <page_ref>
c0104cc9:	83 f8 01             	cmp    $0x1,%eax
c0104ccc:	74 24                	je     c0104cf2 <check_pgdir+0x3c9>
c0104cce:	c7 44 24 0c b6 6e 10 	movl   $0xc0106eb6,0xc(%esp)
c0104cd5:	c0 
c0104cd6:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104cdd:	c0 
c0104cde:	c7 44 24 04 7b 02 00 	movl   $0x27b,0x4(%esp)
c0104ce5:	00 
c0104ce6:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104ced:	e8 41 bf ff ff       	call   c0100c33 <__panic>

    // 将 p1 插入到虚拟地址 PGSIZE，替换掉 p2
    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c0104cf2:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104cf7:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104cfe:	00 
c0104cff:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104d06:	00 
c0104d07:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104d0a:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104d0e:	89 04 24             	mov    %eax,(%esp)
c0104d11:	e8 d8 fa ff ff       	call   c01047ee <page_insert>
c0104d16:	85 c0                	test   %eax,%eax
c0104d18:	74 24                	je     c0104d3e <check_pgdir+0x415>
c0104d1a:	c7 44 24 0c c8 6e 10 	movl   $0xc0106ec8,0xc(%esp)
c0104d21:	c0 
c0104d22:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104d29:	c0 
c0104d2a:	c7 44 24 04 7e 02 00 	movl   $0x27e,0x4(%esp)
c0104d31:	00 
c0104d32:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104d39:	e8 f5 be ff ff       	call   c0100c33 <__panic>
    // 验证 p1 的引用计数增加到 2
    assert(page_ref(p1) == 2);
c0104d3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104d41:	89 04 24             	mov    %eax,(%esp)
c0104d44:	e8 c2 ef ff ff       	call   c0103d0b <page_ref>
c0104d49:	83 f8 02             	cmp    $0x2,%eax
c0104d4c:	74 24                	je     c0104d72 <check_pgdir+0x449>
c0104d4e:	c7 44 24 0c f4 6e 10 	movl   $0xc0106ef4,0xc(%esp)
c0104d55:	c0 
c0104d56:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104d5d:	c0 
c0104d5e:	c7 44 24 04 80 02 00 	movl   $0x280,0x4(%esp)
c0104d65:	00 
c0104d66:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104d6d:	e8 c1 be ff ff       	call   c0100c33 <__panic>
    // 验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
c0104d72:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104d75:	89 04 24             	mov    %eax,(%esp)
c0104d78:	e8 8e ef ff ff       	call   c0103d0b <page_ref>
c0104d7d:	85 c0                	test   %eax,%eax
c0104d7f:	74 24                	je     c0104da5 <check_pgdir+0x47c>
c0104d81:	c7 44 24 0c 06 6f 10 	movl   $0xc0106f06,0xc(%esp)
c0104d88:	c0 
c0104d89:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104d90:	c0 
c0104d91:	c7 44 24 04 82 02 00 	movl   $0x282,0x4(%esp)
c0104d98:	00 
c0104d99:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104da0:	e8 8e be ff ff       	call   c0100c33 <__panic>
     // 获取虚拟地址 PGSIZE 对应的页表项指针
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104da5:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104daa:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104db1:	00 
c0104db2:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104db9:	00 
c0104dba:	89 04 24             	mov    %eax,(%esp)
c0104dbd:	e8 eb f7 ff ff       	call   c01045ad <get_pte>
c0104dc2:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104dc5:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104dc9:	75 24                	jne    c0104def <check_pgdir+0x4c6>
c0104dcb:	c7 44 24 0c 54 6e 10 	movl   $0xc0106e54,0xc(%esp)
c0104dd2:	c0 
c0104dd3:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104dda:	c0 
c0104ddb:	c7 44 24 04 84 02 00 	movl   $0x284,0x4(%esp)
c0104de2:	00 
c0104de3:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104dea:	e8 44 be ff ff       	call   c0100c33 <__panic>
    // 验证页表项对应的页面是 p1
    assert(pte2page(*ptep) == p1);
c0104def:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104df2:	8b 00                	mov    (%eax),%eax
c0104df4:	89 04 24             	mov    %eax,(%esp)
c0104df7:	e8 b5 ee ff ff       	call   c0103cb1 <pte2page>
c0104dfc:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104dff:	74 24                	je     c0104e25 <check_pgdir+0x4fc>
c0104e01:	c7 44 24 0c c9 6d 10 	movl   $0xc0106dc9,0xc(%esp)
c0104e08:	c0 
c0104e09:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104e10:	c0 
c0104e11:	c7 44 24 04 86 02 00 	movl   $0x286,0x4(%esp)
c0104e18:	00 
c0104e19:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104e20:	e8 0e be ff ff       	call   c0100c33 <__panic>
     // 验证页表项没有设置用户权限
    assert((*ptep & PTE_U) == 0);
c0104e25:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104e28:	8b 00                	mov    (%eax),%eax
c0104e2a:	83 e0 04             	and    $0x4,%eax
c0104e2d:	85 c0                	test   %eax,%eax
c0104e2f:	74 24                	je     c0104e55 <check_pgdir+0x52c>
c0104e31:	c7 44 24 0c 18 6f 10 	movl   $0xc0106f18,0xc(%esp)
c0104e38:	c0 
c0104e39:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104e40:	c0 
c0104e41:	c7 44 24 04 88 02 00 	movl   $0x288,0x4(%esp)
c0104e48:	00 
c0104e49:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104e50:	e8 de bd ff ff       	call   c0100c33 <__panic>
    
    //移除虚拟地址 0x0 的映射，
    page_remove(boot_pgdir, 0x0);
c0104e55:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104e5a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104e61:	00 
c0104e62:	89 04 24             	mov    %eax,(%esp)
c0104e65:	e8 3d f9 ff ff       	call   c01047a7 <page_remove>
    //验证 p1 的引用计数减少到 1。
    assert(page_ref(p1) == 1);
c0104e6a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104e6d:	89 04 24             	mov    %eax,(%esp)
c0104e70:	e8 96 ee ff ff       	call   c0103d0b <page_ref>
c0104e75:	83 f8 01             	cmp    $0x1,%eax
c0104e78:	74 24                	je     c0104e9e <check_pgdir+0x575>
c0104e7a:	c7 44 24 0c df 6d 10 	movl   $0xc0106ddf,0xc(%esp)
c0104e81:	c0 
c0104e82:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104e89:	c0 
c0104e8a:	c7 44 24 04 8d 02 00 	movl   $0x28d,0x4(%esp)
c0104e91:	00 
c0104e92:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104e99:	e8 95 bd ff ff       	call   c0100c33 <__panic>
    //验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
c0104e9e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104ea1:	89 04 24             	mov    %eax,(%esp)
c0104ea4:	e8 62 ee ff ff       	call   c0103d0b <page_ref>
c0104ea9:	85 c0                	test   %eax,%eax
c0104eab:	74 24                	je     c0104ed1 <check_pgdir+0x5a8>
c0104ead:	c7 44 24 0c 06 6f 10 	movl   $0xc0106f06,0xc(%esp)
c0104eb4:	c0 
c0104eb5:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104ebc:	c0 
c0104ebd:	c7 44 24 04 8f 02 00 	movl   $0x28f,0x4(%esp)
c0104ec4:	00 
c0104ec5:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104ecc:	e8 62 bd ff ff       	call   c0100c33 <__panic>

    //移除虚拟地址 PGSIZE 的映射，
    page_remove(boot_pgdir, PGSIZE);
c0104ed1:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104ed6:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104edd:	00 
c0104ede:	89 04 24             	mov    %eax,(%esp)
c0104ee1:	e8 c1 f8 ff ff       	call   c01047a7 <page_remove>
    //验证 p1 的引用计数减少到 0
    assert(page_ref(p1) == 0);
c0104ee6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104ee9:	89 04 24             	mov    %eax,(%esp)
c0104eec:	e8 1a ee ff ff       	call   c0103d0b <page_ref>
c0104ef1:	85 c0                	test   %eax,%eax
c0104ef3:	74 24                	je     c0104f19 <check_pgdir+0x5f0>
c0104ef5:	c7 44 24 0c 2d 6f 10 	movl   $0xc0106f2d,0xc(%esp)
c0104efc:	c0 
c0104efd:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104f04:	c0 
c0104f05:	c7 44 24 04 94 02 00 	movl   $0x294,0x4(%esp)
c0104f0c:	00 
c0104f0d:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104f14:	e8 1a bd ff ff       	call   c0100c33 <__panic>
    //验证 p2 的引用计数减少到 0
    assert(page_ref(p2) == 0);
c0104f19:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f1c:	89 04 24             	mov    %eax,(%esp)
c0104f1f:	e8 e7 ed ff ff       	call   c0103d0b <page_ref>
c0104f24:	85 c0                	test   %eax,%eax
c0104f26:	74 24                	je     c0104f4c <check_pgdir+0x623>
c0104f28:	c7 44 24 0c 06 6f 10 	movl   $0xc0106f06,0xc(%esp)
c0104f2f:	c0 
c0104f30:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104f37:	c0 
c0104f38:	c7 44 24 04 96 02 00 	movl   $0x296,0x4(%esp)
c0104f3f:	00 
c0104f40:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104f47:	e8 e7 bc ff ff       	call   c0100c33 <__panic>
    
    //验证页目录的第一页表的引用计数为 1。
    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
c0104f4c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104f51:	8b 00                	mov    (%eax),%eax
c0104f53:	89 04 24             	mov    %eax,(%esp)
c0104f56:	e8 96 ed ff ff       	call   c0103cf1 <pde2page>
c0104f5b:	89 04 24             	mov    %eax,(%esp)
c0104f5e:	e8 a8 ed ff ff       	call   c0103d0b <page_ref>
c0104f63:	83 f8 01             	cmp    $0x1,%eax
c0104f66:	74 24                	je     c0104f8c <check_pgdir+0x663>
c0104f68:	c7 44 24 0c 40 6f 10 	movl   $0xc0106f40,0xc(%esp)
c0104f6f:	c0 
c0104f70:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0104f77:	c0 
c0104f78:	c7 44 24 04 99 02 00 	movl   $0x299,0x4(%esp)
c0104f7f:	00 
c0104f80:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0104f87:	e8 a7 bc ff ff       	call   c0100c33 <__panic>
    //释放页目录的第一页表
    free_page(pde2page(boot_pgdir[0]));
c0104f8c:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104f91:	8b 00                	mov    (%eax),%eax
c0104f93:	89 04 24             	mov    %eax,(%esp)
c0104f96:	e8 56 ed ff ff       	call   c0103cf1 <pde2page>
c0104f9b:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104fa2:	00 
c0104fa3:	89 04 24             	mov    %eax,(%esp)
c0104fa6:	e8 aa ef ff ff       	call   c0103f55 <free_pages>
    //清空页目录的第一页表
    boot_pgdir[0] = 0;
c0104fab:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0104fb0:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
c0104fb6:	c7 04 24 67 6f 10 c0 	movl   $0xc0106f67,(%esp)
c0104fbd:	e8 a4 b3 ff ff       	call   c0100366 <cprintf>
}
c0104fc2:	90                   	nop
c0104fc3:	89 ec                	mov    %ebp,%esp
c0104fc5:	5d                   	pop    %ebp
c0104fc6:	c3                   	ret    

c0104fc7 <check_boot_pgdir>:

//检查内核页表 boot_pgdir 的正确性
static void
check_boot_pgdir(void) {
c0104fc7:	55                   	push   %ebp
c0104fc8:	89 e5                	mov    %esp,%ebp
c0104fca:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;// 定义一个指向页表项的指针
    int i;
    for (i = 0; i < npage; i += PGSIZE) {// 遍历所有页面
c0104fcd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0104fd4:	e9 ca 00 00 00       	jmp    c01050a3 <check_boot_pgdir+0xdc>
        // 获取第 i 个页面的页表项，并确保其不为空
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c0104fd9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104fdc:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0104fdf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104fe2:	c1 e8 0c             	shr    $0xc,%eax
c0104fe5:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0104fe8:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c0104fed:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0104ff0:	72 23                	jb     c0105015 <check_boot_pgdir+0x4e>
c0104ff2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104ff5:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104ff9:	c7 44 24 08 ac 6b 10 	movl   $0xc0106bac,0x8(%esp)
c0105000:	c0 
c0105001:	c7 44 24 04 a9 02 00 	movl   $0x2a9,0x4(%esp)
c0105008:	00 
c0105009:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105010:	e8 1e bc ff ff       	call   c0100c33 <__panic>
c0105015:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105018:	2d 00 00 00 40       	sub    $0x40000000,%eax
c010501d:	89 c2                	mov    %eax,%edx
c010501f:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c0105024:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010502b:	00 
c010502c:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105030:	89 04 24             	mov    %eax,(%esp)
c0105033:	e8 75 f5 ff ff       	call   c01045ad <get_pte>
c0105038:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010503b:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c010503f:	75 24                	jne    c0105065 <check_boot_pgdir+0x9e>
c0105041:	c7 44 24 0c 84 6f 10 	movl   $0xc0106f84,0xc(%esp)
c0105048:	c0 
c0105049:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0105050:	c0 
c0105051:	c7 44 24 04 a9 02 00 	movl   $0x2a9,0x4(%esp)
c0105058:	00 
c0105059:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105060:	e8 ce bb ff ff       	call   c0100c33 <__panic>
        // 验证页表项的物理地址是否正确
        assert(PTE_ADDR(*ptep) == i);
c0105065:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105068:	8b 00                	mov    (%eax),%eax
c010506a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c010506f:	89 c2                	mov    %eax,%edx
c0105071:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105074:	39 c2                	cmp    %eax,%edx
c0105076:	74 24                	je     c010509c <check_boot_pgdir+0xd5>
c0105078:	c7 44 24 0c c1 6f 10 	movl   $0xc0106fc1,0xc(%esp)
c010507f:	c0 
c0105080:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0105087:	c0 
c0105088:	c7 44 24 04 ab 02 00 	movl   $0x2ab,0x4(%esp)
c010508f:	00 
c0105090:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105097:	e8 97 bb ff ff       	call   c0100c33 <__panic>
    for (i = 0; i < npage; i += PGSIZE) {// 遍历所有页面
c010509c:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
c01050a3:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01050a6:	a1 04 cf 11 c0       	mov    0xc011cf04,%eax
c01050ab:	39 c2                	cmp    %eax,%edx
c01050ad:	0f 82 26 ff ff ff    	jb     c0104fd9 <check_boot_pgdir+0x12>
    }
    // 验证页目录项的物理地址是否正确
    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c01050b3:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01050b8:	05 ac 0f 00 00       	add    $0xfac,%eax
c01050bd:	8b 00                	mov    (%eax),%eax
c01050bf:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01050c4:	89 c2                	mov    %eax,%edx
c01050c6:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01050cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01050ce:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c01050d5:	77 23                	ja     c01050fa <check_boot_pgdir+0x133>
c01050d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01050da:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01050de:	c7 44 24 08 50 6c 10 	movl   $0xc0106c50,0x8(%esp)
c01050e5:	c0 
c01050e6:	c7 44 24 04 ae 02 00 	movl   $0x2ae,0x4(%esp)
c01050ed:	00 
c01050ee:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01050f5:	e8 39 bb ff ff       	call   c0100c33 <__panic>
c01050fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01050fd:	05 00 00 00 40       	add    $0x40000000,%eax
c0105102:	39 d0                	cmp    %edx,%eax
c0105104:	74 24                	je     c010512a <check_boot_pgdir+0x163>
c0105106:	c7 44 24 0c d8 6f 10 	movl   $0xc0106fd8,0xc(%esp)
c010510d:	c0 
c010510e:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0105115:	c0 
c0105116:	c7 44 24 04 ae 02 00 	movl   $0x2ae,0x4(%esp)
c010511d:	00 
c010511e:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105125:	e8 09 bb ff ff       	call   c0100c33 <__panic>

    assert(boot_pgdir[0] == 0);// 确保页目录的第一个项为0
c010512a:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010512f:	8b 00                	mov    (%eax),%eax
c0105131:	85 c0                	test   %eax,%eax
c0105133:	74 24                	je     c0105159 <check_boot_pgdir+0x192>
c0105135:	c7 44 24 0c 0c 70 10 	movl   $0xc010700c,0xc(%esp)
c010513c:	c0 
c010513d:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0105144:	c0 
c0105145:	c7 44 24 04 b0 02 00 	movl   $0x2b0,0x4(%esp)
c010514c:	00 
c010514d:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105154:	e8 da ba ff ff       	call   c0100c33 <__panic>

    struct Page *p;// 定义一个指向页面的指针
    p = alloc_page();// 分配一个页面
c0105159:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0105160:	e8 b6 ed ff ff       	call   c0103f1b <alloc_pages>
c0105165:	89 45 ec             	mov    %eax,-0x14(%ebp)
    // 将页面插入到虚拟地址 0x100，并确保操作成功
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c0105168:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010516d:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105174:	00 
c0105175:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
c010517c:	00 
c010517d:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105180:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105184:	89 04 24             	mov    %eax,(%esp)
c0105187:	e8 62 f6 ff ff       	call   c01047ee <page_insert>
c010518c:	85 c0                	test   %eax,%eax
c010518e:	74 24                	je     c01051b4 <check_boot_pgdir+0x1ed>
c0105190:	c7 44 24 0c 20 70 10 	movl   $0xc0107020,0xc(%esp)
c0105197:	c0 
c0105198:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c010519f:	c0 
c01051a0:	c7 44 24 04 b5 02 00 	movl   $0x2b5,0x4(%esp)
c01051a7:	00 
c01051a8:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01051af:	e8 7f ba ff ff       	call   c0100c33 <__panic>
    assert(page_ref(p) == 1);// 验证页面的引用计数为1
c01051b4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01051b7:	89 04 24             	mov    %eax,(%esp)
c01051ba:	e8 4c eb ff ff       	call   c0103d0b <page_ref>
c01051bf:	83 f8 01             	cmp    $0x1,%eax
c01051c2:	74 24                	je     c01051e8 <check_boot_pgdir+0x221>
c01051c4:	c7 44 24 0c 4e 70 10 	movl   $0xc010704e,0xc(%esp)
c01051cb:	c0 
c01051cc:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c01051d3:	c0 
c01051d4:	c7 44 24 04 b6 02 00 	movl   $0x2b6,0x4(%esp)
c01051db:	00 
c01051dc:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01051e3:	e8 4b ba ff ff       	call   c0100c33 <__panic>
    // 将页面插入到虚拟地址 0x100 + PGSIZE，并确保操作成功
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c01051e8:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c01051ed:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c01051f4:	00 
c01051f5:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
c01051fc:	00 
c01051fd:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105200:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105204:	89 04 24             	mov    %eax,(%esp)
c0105207:	e8 e2 f5 ff ff       	call   c01047ee <page_insert>
c010520c:	85 c0                	test   %eax,%eax
c010520e:	74 24                	je     c0105234 <check_boot_pgdir+0x26d>
c0105210:	c7 44 24 0c 60 70 10 	movl   $0xc0107060,0xc(%esp)
c0105217:	c0 
c0105218:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c010521f:	c0 
c0105220:	c7 44 24 04 b8 02 00 	movl   $0x2b8,0x4(%esp)
c0105227:	00 
c0105228:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c010522f:	e8 ff b9 ff ff       	call   c0100c33 <__panic>
    assert(page_ref(p) == 2);// 验证页面的引用计数为2
c0105234:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105237:	89 04 24             	mov    %eax,(%esp)
c010523a:	e8 cc ea ff ff       	call   c0103d0b <page_ref>
c010523f:	83 f8 02             	cmp    $0x2,%eax
c0105242:	74 24                	je     c0105268 <check_boot_pgdir+0x2a1>
c0105244:	c7 44 24 0c 97 70 10 	movl   $0xc0107097,0xc(%esp)
c010524b:	c0 
c010524c:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c0105253:	c0 
c0105254:	c7 44 24 04 b9 02 00 	movl   $0x2b9,0x4(%esp)
c010525b:	00 
c010525c:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105263:	e8 cb b9 ff ff       	call   c0100c33 <__panic>

    const char *str = "ucore: Hello world!!";// 定义一个字符串
c0105268:	c7 45 e8 a8 70 10 c0 	movl   $0xc01070a8,-0x18(%ebp)
    strcpy((void *)0x100, str);// 将字符串复制到虚拟地址 0x100
c010526f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105272:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105276:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c010527d:	e8 fc 09 00 00       	call   c0105c7e <strcpy>
    // 验证两个映射地址的数据是否一致
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c0105282:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
c0105289:	00 
c010528a:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105291:	e8 60 0a 00 00       	call   c0105cf6 <strcmp>
c0105296:	85 c0                	test   %eax,%eax
c0105298:	74 24                	je     c01052be <check_boot_pgdir+0x2f7>
c010529a:	c7 44 24 0c c0 70 10 	movl   $0xc01070c0,0xc(%esp)
c01052a1:	c0 
c01052a2:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c01052a9:	c0 
c01052aa:	c7 44 24 04 be 02 00 	movl   $0x2be,0x4(%esp)
c01052b1:	00 
c01052b2:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c01052b9:	e8 75 b9 ff ff       	call   c0100c33 <__panic>
    // 在页面的 0x100 偏移处设置字符串结束符
    *(char *)(page2kva(p) + 0x100) = '\0';
c01052be:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01052c1:	89 04 24             	mov    %eax,(%esp)
c01052c4:	e8 92 e9 ff ff       	call   c0103c5b <page2kva>
c01052c9:	05 00 01 00 00       	add    $0x100,%eax
c01052ce:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);// 验证字符串长度为0
c01052d1:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c01052d8:	e8 47 09 00 00       	call   c0105c24 <strlen>
c01052dd:	85 c0                	test   %eax,%eax
c01052df:	74 24                	je     c0105305 <check_boot_pgdir+0x33e>
c01052e1:	c7 44 24 0c f8 70 10 	movl   $0xc01070f8,0xc(%esp)
c01052e8:	c0 
c01052e9:	c7 44 24 08 99 6c 10 	movl   $0xc0106c99,0x8(%esp)
c01052f0:	c0 
c01052f1:	c7 44 24 04 c1 02 00 	movl   $0x2c1,0x4(%esp)
c01052f8:	00 
c01052f9:	c7 04 24 74 6c 10 c0 	movl   $0xc0106c74,(%esp)
c0105300:	e8 2e b9 ff ff       	call   c0100c33 <__panic>

    free_page(p);// 释放页面 p
c0105305:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010530c:	00 
c010530d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105310:	89 04 24             	mov    %eax,(%esp)
c0105313:	e8 3d ec ff ff       	call   c0103f55 <free_pages>
    free_page(pde2page(boot_pgdir[0]));// 释放页目录项对应的页面
c0105318:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010531d:	8b 00                	mov    (%eax),%eax
c010531f:	89 04 24             	mov    %eax,(%esp)
c0105322:	e8 ca e9 ff ff       	call   c0103cf1 <pde2page>
c0105327:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010532e:	00 
c010532f:	89 04 24             	mov    %eax,(%esp)
c0105332:	e8 1e ec ff ff       	call   c0103f55 <free_pages>
    boot_pgdir[0] = 0;// 将页目录的第一个项设为0
c0105337:	a1 e0 99 11 c0       	mov    0xc01199e0,%eax
c010533c:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");// 输出成功信息
c0105342:	c7 04 24 1c 71 10 c0 	movl   $0xc010711c,(%esp)
c0105349:	e8 18 b0 ff ff       	call   c0100366 <cprintf>
}
c010534e:	90                   	nop
c010534f:	89 ec                	mov    %ebp,%esp
c0105351:	5d                   	pop    %ebp
c0105352:	c3                   	ret    

c0105353 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
c0105353:	55                   	push   %ebp
c0105354:	89 e5                	mov    %esp,%ebp
    //定义一个静态字符数组 str，长度为4
    static char str[4];
    //如果 perm 与 PTE_U 按位与的结果不为0，则 str[0] 设置为 'u'，否则设置为 '-'
    str[0] = (perm & PTE_U) ? 'u' : '-';
c0105356:	8b 45 08             	mov    0x8(%ebp),%eax
c0105359:	83 e0 04             	and    $0x4,%eax
c010535c:	85 c0                	test   %eax,%eax
c010535e:	74 04                	je     c0105364 <perm2str+0x11>
c0105360:	b0 75                	mov    $0x75,%al
c0105362:	eb 02                	jmp    c0105366 <perm2str+0x13>
c0105364:	b0 2d                	mov    $0x2d,%al
c0105366:	a2 88 cf 11 c0       	mov    %al,0xc011cf88
    //str[1] 始终设置为 'r'
    str[1] = 'r';
c010536b:	c6 05 89 cf 11 c0 72 	movb   $0x72,0xc011cf89
    //如果 perm 与 PTE_W 按位与的结果不为0，则 str[2] 设置为 'w'，否则设置为 '-'
    str[2] = (perm & PTE_W) ? 'w' : '-';
c0105372:	8b 45 08             	mov    0x8(%ebp),%eax
c0105375:	83 e0 02             	and    $0x2,%eax
c0105378:	85 c0                	test   %eax,%eax
c010537a:	74 04                	je     c0105380 <perm2str+0x2d>
c010537c:	b0 77                	mov    $0x77,%al
c010537e:	eb 02                	jmp    c0105382 <perm2str+0x2f>
c0105380:	b0 2d                	mov    $0x2d,%al
c0105382:	a2 8a cf 11 c0       	mov    %al,0xc011cf8a
    //str[3] 设置为字符串结束符 \0
    str[3] = '\0';
c0105387:	c6 05 8b cf 11 c0 00 	movb   $0x0,0xc011cf8b
    return str;
c010538e:	b8 88 cf 11 c0       	mov    $0xc011cf88,%eax
}
c0105393:	5d                   	pop    %ebp
c0105394:	c3                   	ret    

c0105395 <get_pgtable_items>:
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
//从页表中获取指定范围内的有效项，并根据权限进行处理。
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
c0105395:	55                   	push   %ebp
c0105396:	89 e5                	mov    %esp,%ebp
c0105398:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {// 检查起始索引是否超出右边界
c010539b:	8b 45 10             	mov    0x10(%ebp),%eax
c010539e:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01053a1:	72 0d                	jb     c01053b0 <get_pgtable_items+0x1b>
        return 0;// 如果超出右边界，返回0
c01053a3:	b8 00 00 00 00       	mov    $0x0,%eax
c01053a8:	e9 98 00 00 00       	jmp    c0105445 <get_pgtable_items+0xb0>
    }
    while (start < right && !(table[start] & PTE_P)) {// 查找第一个有效项（PTE_P位为1的项）
        start ++;// 索引递增
c01053ad:	ff 45 10             	incl   0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {// 查找第一个有效项（PTE_P位为1的项）
c01053b0:	8b 45 10             	mov    0x10(%ebp),%eax
c01053b3:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01053b6:	73 18                	jae    c01053d0 <get_pgtable_items+0x3b>
c01053b8:	8b 45 10             	mov    0x10(%ebp),%eax
c01053bb:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c01053c2:	8b 45 14             	mov    0x14(%ebp),%eax
c01053c5:	01 d0                	add    %edx,%eax
c01053c7:	8b 00                	mov    (%eax),%eax
c01053c9:	83 e0 01             	and    $0x1,%eax
c01053cc:	85 c0                	test   %eax,%eax
c01053ce:	74 dd                	je     c01053ad <get_pgtable_items+0x18>
    }
    if (start < right) {// 检查是否找到有效项
c01053d0:	8b 45 10             	mov    0x10(%ebp),%eax
c01053d3:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01053d6:	73 68                	jae    c0105440 <get_pgtable_items+0xab>
        if (left_store != NULL) {// 如果left_store不为NULL
c01053d8:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c01053dc:	74 08                	je     c01053e6 <get_pgtable_items+0x51>
            *left_store = start;// 记录左边界索引
c01053de:	8b 45 18             	mov    0x18(%ebp),%eax
c01053e1:	8b 55 10             	mov    0x10(%ebp),%edx
c01053e4:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);// 获取当前项的用户权限位并递增索引
c01053e6:	8b 45 10             	mov    0x10(%ebp),%eax
c01053e9:	8d 50 01             	lea    0x1(%eax),%edx
c01053ec:	89 55 10             	mov    %edx,0x10(%ebp)
c01053ef:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c01053f6:	8b 45 14             	mov    0x14(%ebp),%eax
c01053f9:	01 d0                	add    %edx,%eax
c01053fb:	8b 00                	mov    (%eax),%eax
c01053fd:	83 e0 07             	and    $0x7,%eax
c0105400:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {// 查找具有相同用户权限的连续项
c0105403:	eb 03                	jmp    c0105408 <get_pgtable_items+0x73>
            start ++;// 索引递增
c0105405:	ff 45 10             	incl   0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {// 查找具有相同用户权限的连续项
c0105408:	8b 45 10             	mov    0x10(%ebp),%eax
c010540b:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010540e:	73 1d                	jae    c010542d <get_pgtable_items+0x98>
c0105410:	8b 45 10             	mov    0x10(%ebp),%eax
c0105413:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c010541a:	8b 45 14             	mov    0x14(%ebp),%eax
c010541d:	01 d0                	add    %edx,%eax
c010541f:	8b 00                	mov    (%eax),%eax
c0105421:	83 e0 07             	and    $0x7,%eax
c0105424:	89 c2                	mov    %eax,%edx
c0105426:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105429:	39 c2                	cmp    %eax,%edx
c010542b:	74 d8                	je     c0105405 <get_pgtable_items+0x70>
        }
        if (right_store != NULL) {// 如果right_store不为NULL
c010542d:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c0105431:	74 08                	je     c010543b <get_pgtable_items+0xa6>
            *right_store = start;// 记录右边界索引
c0105433:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0105436:	8b 55 10             	mov    0x10(%ebp),%edx
c0105439:	89 10                	mov    %edx,(%eax)
        }
        return perm;// 返回用户权限位
c010543b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010543e:	eb 05                	jmp    c0105445 <get_pgtable_items+0xb0>
    }
    return 0;// 如果未找到有效项，返回0
c0105440:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105445:	89 ec                	mov    %ebp,%esp
c0105447:	5d                   	pop    %ebp
c0105448:	c3                   	ret    

c0105449 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
c0105449:	55                   	push   %ebp
c010544a:	89 e5                	mov    %esp,%ebp
c010544c:	57                   	push   %edi
c010544d:	56                   	push   %esi
c010544e:	53                   	push   %ebx
c010544f:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
c0105452:	c7 04 24 3c 71 10 c0 	movl   $0xc010713c,(%esp)
c0105459:	e8 08 af ff ff       	call   c0100366 <cprintf>
    // 定义变量 left, right 和 perm
    size_t left, right = 0, perm;
c010545e:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    // 遍历页目录项
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c0105465:	e9 f2 00 00 00       	jmp    c010555c <print_pgdir+0x113>
        // 打印页目录项的信息
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c010546a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010546d:	89 04 24             	mov    %eax,(%esp)
c0105470:	e8 de fe ff ff       	call   c0105353 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c0105475:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105478:	8b 4d e0             	mov    -0x20(%ebp),%ecx
c010547b:	29 ca                	sub    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c010547d:	89 d6                	mov    %edx,%esi
c010547f:	c1 e6 16             	shl    $0x16,%esi
c0105482:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105485:	89 d3                	mov    %edx,%ebx
c0105487:	c1 e3 16             	shl    $0x16,%ebx
c010548a:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010548d:	89 d1                	mov    %edx,%ecx
c010548f:	c1 e1 16             	shl    $0x16,%ecx
c0105492:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105495:	8b 7d e0             	mov    -0x20(%ebp),%edi
c0105498:	29 fa                	sub    %edi,%edx
c010549a:	89 44 24 14          	mov    %eax,0x14(%esp)
c010549e:	89 74 24 10          	mov    %esi,0x10(%esp)
c01054a2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c01054a6:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c01054aa:	89 54 24 04          	mov    %edx,0x4(%esp)
c01054ae:	c7 04 24 6d 71 10 c0 	movl   $0xc010716d,(%esp)
c01054b5:	e8 ac ae ff ff       	call   c0100366 <cprintf>
        // 计算页表项的起始和结束索引
        size_t l, r = left * NPTEENTRY;
c01054ba:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01054bd:	c1 e0 0a             	shl    $0xa,%eax
c01054c0:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        // 遍历页表项
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c01054c3:	eb 50                	jmp    c0105515 <print_pgdir+0xcc>
            // 打印页表项的信息
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c01054c5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01054c8:	89 04 24             	mov    %eax,(%esp)
c01054cb:	e8 83 fe ff ff       	call   c0105353 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c01054d0:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01054d3:	8b 4d d8             	mov    -0x28(%ebp),%ecx
c01054d6:	29 ca                	sub    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c01054d8:	89 d6                	mov    %edx,%esi
c01054da:	c1 e6 0c             	shl    $0xc,%esi
c01054dd:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01054e0:	89 d3                	mov    %edx,%ebx
c01054e2:	c1 e3 0c             	shl    $0xc,%ebx
c01054e5:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01054e8:	89 d1                	mov    %edx,%ecx
c01054ea:	c1 e1 0c             	shl    $0xc,%ecx
c01054ed:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01054f0:	8b 7d d8             	mov    -0x28(%ebp),%edi
c01054f3:	29 fa                	sub    %edi,%edx
c01054f5:	89 44 24 14          	mov    %eax,0x14(%esp)
c01054f9:	89 74 24 10          	mov    %esi,0x10(%esp)
c01054fd:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105501:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0105505:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105509:	c7 04 24 8c 71 10 c0 	movl   $0xc010718c,(%esp)
c0105510:	e8 51 ae ff ff       	call   c0100366 <cprintf>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c0105515:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
c010551a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010551d:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105520:	89 d3                	mov    %edx,%ebx
c0105522:	c1 e3 0a             	shl    $0xa,%ebx
c0105525:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105528:	89 d1                	mov    %edx,%ecx
c010552a:	c1 e1 0a             	shl    $0xa,%ecx
c010552d:	8d 55 d4             	lea    -0x2c(%ebp),%edx
c0105530:	89 54 24 14          	mov    %edx,0x14(%esp)
c0105534:	8d 55 d8             	lea    -0x28(%ebp),%edx
c0105537:	89 54 24 10          	mov    %edx,0x10(%esp)
c010553b:	89 74 24 0c          	mov    %esi,0xc(%esp)
c010553f:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105543:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0105547:	89 0c 24             	mov    %ecx,(%esp)
c010554a:	e8 46 fe ff ff       	call   c0105395 <get_pgtable_items>
c010554f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105552:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0105556:	0f 85 69 ff ff ff    	jne    c01054c5 <print_pgdir+0x7c>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c010555c:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
c0105561:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105564:	8d 55 dc             	lea    -0x24(%ebp),%edx
c0105567:	89 54 24 14          	mov    %edx,0x14(%esp)
c010556b:	8d 55 e0             	lea    -0x20(%ebp),%edx
c010556e:	89 54 24 10          	mov    %edx,0x10(%esp)
c0105572:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c0105576:	89 44 24 08          	mov    %eax,0x8(%esp)
c010557a:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
c0105581:	00 
c0105582:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0105589:	e8 07 fe ff ff       	call   c0105395 <get_pgtable_items>
c010558e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105591:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0105595:	0f 85 cf fe ff ff    	jne    c010546a <print_pgdir+0x21>
        }
    }
    cprintf("--------------------- END ---------------------\n");
c010559b:	c7 04 24 b0 71 10 c0 	movl   $0xc01071b0,(%esp)
c01055a2:	e8 bf ad ff ff       	call   c0100366 <cprintf>
}
c01055a7:	90                   	nop
c01055a8:	83 c4 4c             	add    $0x4c,%esp
c01055ab:	5b                   	pop    %ebx
c01055ac:	5e                   	pop    %esi
c01055ad:	5f                   	pop    %edi
c01055ae:	5d                   	pop    %ebp
c01055af:	c3                   	ret    

c01055b0 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
c01055b0:	55                   	push   %ebp
c01055b1:	89 e5                	mov    %esp,%ebp
c01055b3:	83 ec 58             	sub    $0x58,%esp
c01055b6:	8b 45 10             	mov    0x10(%ebp),%eax
c01055b9:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01055bc:	8b 45 14             	mov    0x14(%ebp),%eax
c01055bf:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
c01055c2:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01055c5:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01055c8:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01055cb:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
c01055ce:	8b 45 18             	mov    0x18(%ebp),%eax
c01055d1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01055d4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01055d7:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01055da:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01055dd:	89 55 f0             	mov    %edx,-0x10(%ebp)
c01055e0:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01055e3:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01055e6:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01055ea:	74 1c                	je     c0105608 <printnum+0x58>
c01055ec:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01055ef:	ba 00 00 00 00       	mov    $0x0,%edx
c01055f4:	f7 75 e4             	divl   -0x1c(%ebp)
c01055f7:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01055fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01055fd:	ba 00 00 00 00       	mov    $0x0,%edx
c0105602:	f7 75 e4             	divl   -0x1c(%ebp)
c0105605:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105608:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010560b:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010560e:	f7 75 e4             	divl   -0x1c(%ebp)
c0105611:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105614:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0105617:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010561a:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010561d:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105620:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0105623:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105626:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
c0105629:	8b 45 18             	mov    0x18(%ebp),%eax
c010562c:	ba 00 00 00 00       	mov    $0x0,%edx
c0105631:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0105634:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0105637:	19 d1                	sbb    %edx,%ecx
c0105639:	72 4c                	jb     c0105687 <printnum+0xd7>
        printnum(putch, putdat, result, base, width - 1, padc);
c010563b:	8b 45 1c             	mov    0x1c(%ebp),%eax
c010563e:	8d 50 ff             	lea    -0x1(%eax),%edx
c0105641:	8b 45 20             	mov    0x20(%ebp),%eax
c0105644:	89 44 24 18          	mov    %eax,0x18(%esp)
c0105648:	89 54 24 14          	mov    %edx,0x14(%esp)
c010564c:	8b 45 18             	mov    0x18(%ebp),%eax
c010564f:	89 44 24 10          	mov    %eax,0x10(%esp)
c0105653:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105656:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105659:	89 44 24 08          	mov    %eax,0x8(%esp)
c010565d:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0105661:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105664:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105668:	8b 45 08             	mov    0x8(%ebp),%eax
c010566b:	89 04 24             	mov    %eax,(%esp)
c010566e:	e8 3d ff ff ff       	call   c01055b0 <printnum>
c0105673:	eb 1b                	jmp    c0105690 <printnum+0xe0>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
c0105675:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105678:	89 44 24 04          	mov    %eax,0x4(%esp)
c010567c:	8b 45 20             	mov    0x20(%ebp),%eax
c010567f:	89 04 24             	mov    %eax,(%esp)
c0105682:	8b 45 08             	mov    0x8(%ebp),%eax
c0105685:	ff d0                	call   *%eax
        while (-- width > 0)
c0105687:	ff 4d 1c             	decl   0x1c(%ebp)
c010568a:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c010568e:	7f e5                	jg     c0105675 <printnum+0xc5>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
c0105690:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105693:	05 64 72 10 c0       	add    $0xc0107264,%eax
c0105698:	0f b6 00             	movzbl (%eax),%eax
c010569b:	0f be c0             	movsbl %al,%eax
c010569e:	8b 55 0c             	mov    0xc(%ebp),%edx
c01056a1:	89 54 24 04          	mov    %edx,0x4(%esp)
c01056a5:	89 04 24             	mov    %eax,(%esp)
c01056a8:	8b 45 08             	mov    0x8(%ebp),%eax
c01056ab:	ff d0                	call   *%eax
}
c01056ad:	90                   	nop
c01056ae:	89 ec                	mov    %ebp,%esp
c01056b0:	5d                   	pop    %ebp
c01056b1:	c3                   	ret    

c01056b2 <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c01056b2:	55                   	push   %ebp
c01056b3:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c01056b5:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c01056b9:	7e 14                	jle    c01056cf <getuint+0x1d>
        return va_arg(*ap, unsigned long long);
c01056bb:	8b 45 08             	mov    0x8(%ebp),%eax
c01056be:	8b 00                	mov    (%eax),%eax
c01056c0:	8d 48 08             	lea    0x8(%eax),%ecx
c01056c3:	8b 55 08             	mov    0x8(%ebp),%edx
c01056c6:	89 0a                	mov    %ecx,(%edx)
c01056c8:	8b 50 04             	mov    0x4(%eax),%edx
c01056cb:	8b 00                	mov    (%eax),%eax
c01056cd:	eb 30                	jmp    c01056ff <getuint+0x4d>
    }
    else if (lflag) {
c01056cf:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c01056d3:	74 16                	je     c01056eb <getuint+0x39>
        return va_arg(*ap, unsigned long);
c01056d5:	8b 45 08             	mov    0x8(%ebp),%eax
c01056d8:	8b 00                	mov    (%eax),%eax
c01056da:	8d 48 04             	lea    0x4(%eax),%ecx
c01056dd:	8b 55 08             	mov    0x8(%ebp),%edx
c01056e0:	89 0a                	mov    %ecx,(%edx)
c01056e2:	8b 00                	mov    (%eax),%eax
c01056e4:	ba 00 00 00 00       	mov    $0x0,%edx
c01056e9:	eb 14                	jmp    c01056ff <getuint+0x4d>
    }
    else {
        return va_arg(*ap, unsigned int);
c01056eb:	8b 45 08             	mov    0x8(%ebp),%eax
c01056ee:	8b 00                	mov    (%eax),%eax
c01056f0:	8d 48 04             	lea    0x4(%eax),%ecx
c01056f3:	8b 55 08             	mov    0x8(%ebp),%edx
c01056f6:	89 0a                	mov    %ecx,(%edx)
c01056f8:	8b 00                	mov    (%eax),%eax
c01056fa:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
c01056ff:	5d                   	pop    %ebp
c0105700:	c3                   	ret    

c0105701 <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c0105701:	55                   	push   %ebp
c0105702:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0105704:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0105708:	7e 14                	jle    c010571e <getint+0x1d>
        return va_arg(*ap, long long);
c010570a:	8b 45 08             	mov    0x8(%ebp),%eax
c010570d:	8b 00                	mov    (%eax),%eax
c010570f:	8d 48 08             	lea    0x8(%eax),%ecx
c0105712:	8b 55 08             	mov    0x8(%ebp),%edx
c0105715:	89 0a                	mov    %ecx,(%edx)
c0105717:	8b 50 04             	mov    0x4(%eax),%edx
c010571a:	8b 00                	mov    (%eax),%eax
c010571c:	eb 28                	jmp    c0105746 <getint+0x45>
    }
    else if (lflag) {
c010571e:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0105722:	74 12                	je     c0105736 <getint+0x35>
        return va_arg(*ap, long);
c0105724:	8b 45 08             	mov    0x8(%ebp),%eax
c0105727:	8b 00                	mov    (%eax),%eax
c0105729:	8d 48 04             	lea    0x4(%eax),%ecx
c010572c:	8b 55 08             	mov    0x8(%ebp),%edx
c010572f:	89 0a                	mov    %ecx,(%edx)
c0105731:	8b 00                	mov    (%eax),%eax
c0105733:	99                   	cltd   
c0105734:	eb 10                	jmp    c0105746 <getint+0x45>
    }
    else {
        return va_arg(*ap, int);
c0105736:	8b 45 08             	mov    0x8(%ebp),%eax
c0105739:	8b 00                	mov    (%eax),%eax
c010573b:	8d 48 04             	lea    0x4(%eax),%ecx
c010573e:	8b 55 08             	mov    0x8(%ebp),%edx
c0105741:	89 0a                	mov    %ecx,(%edx)
c0105743:	8b 00                	mov    (%eax),%eax
c0105745:	99                   	cltd   
    }
}
c0105746:	5d                   	pop    %ebp
c0105747:	c3                   	ret    

c0105748 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c0105748:	55                   	push   %ebp
c0105749:	89 e5                	mov    %esp,%ebp
c010574b:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
c010574e:	8d 45 14             	lea    0x14(%ebp),%eax
c0105751:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
c0105754:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105757:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010575b:	8b 45 10             	mov    0x10(%ebp),%eax
c010575e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105762:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105765:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105769:	8b 45 08             	mov    0x8(%ebp),%eax
c010576c:	89 04 24             	mov    %eax,(%esp)
c010576f:	e8 05 00 00 00       	call   c0105779 <vprintfmt>
    va_end(ap);
}
c0105774:	90                   	nop
c0105775:	89 ec                	mov    %ebp,%esp
c0105777:	5d                   	pop    %ebp
c0105778:	c3                   	ret    

c0105779 <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c0105779:	55                   	push   %ebp
c010577a:	89 e5                	mov    %esp,%ebp
c010577c:	56                   	push   %esi
c010577d:	53                   	push   %ebx
c010577e:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0105781:	eb 17                	jmp    c010579a <vprintfmt+0x21>
            if (ch == '\0') {
c0105783:	85 db                	test   %ebx,%ebx
c0105785:	0f 84 bf 03 00 00    	je     c0105b4a <vprintfmt+0x3d1>
                return;
            }
            putch(ch, putdat);
c010578b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010578e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105792:	89 1c 24             	mov    %ebx,(%esp)
c0105795:	8b 45 08             	mov    0x8(%ebp),%eax
c0105798:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c010579a:	8b 45 10             	mov    0x10(%ebp),%eax
c010579d:	8d 50 01             	lea    0x1(%eax),%edx
c01057a0:	89 55 10             	mov    %edx,0x10(%ebp)
c01057a3:	0f b6 00             	movzbl (%eax),%eax
c01057a6:	0f b6 d8             	movzbl %al,%ebx
c01057a9:	83 fb 25             	cmp    $0x25,%ebx
c01057ac:	75 d5                	jne    c0105783 <vprintfmt+0xa>
        }

        // Process a %-escape sequence
        char padc = ' ';
c01057ae:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
c01057b2:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
c01057b9:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01057bc:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
c01057bf:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c01057c6:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01057c9:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
c01057cc:	8b 45 10             	mov    0x10(%ebp),%eax
c01057cf:	8d 50 01             	lea    0x1(%eax),%edx
c01057d2:	89 55 10             	mov    %edx,0x10(%ebp)
c01057d5:	0f b6 00             	movzbl (%eax),%eax
c01057d8:	0f b6 d8             	movzbl %al,%ebx
c01057db:	8d 43 dd             	lea    -0x23(%ebx),%eax
c01057de:	83 f8 55             	cmp    $0x55,%eax
c01057e1:	0f 87 37 03 00 00    	ja     c0105b1e <vprintfmt+0x3a5>
c01057e7:	8b 04 85 88 72 10 c0 	mov    -0x3fef8d78(,%eax,4),%eax
c01057ee:	ff e0                	jmp    *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
c01057f0:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
c01057f4:	eb d6                	jmp    c01057cc <vprintfmt+0x53>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
c01057f6:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
c01057fa:	eb d0                	jmp    c01057cc <vprintfmt+0x53>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c01057fc:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
c0105803:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105806:	89 d0                	mov    %edx,%eax
c0105808:	c1 e0 02             	shl    $0x2,%eax
c010580b:	01 d0                	add    %edx,%eax
c010580d:	01 c0                	add    %eax,%eax
c010580f:	01 d8                	add    %ebx,%eax
c0105811:	83 e8 30             	sub    $0x30,%eax
c0105814:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
c0105817:	8b 45 10             	mov    0x10(%ebp),%eax
c010581a:	0f b6 00             	movzbl (%eax),%eax
c010581d:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
c0105820:	83 fb 2f             	cmp    $0x2f,%ebx
c0105823:	7e 38                	jle    c010585d <vprintfmt+0xe4>
c0105825:	83 fb 39             	cmp    $0x39,%ebx
c0105828:	7f 33                	jg     c010585d <vprintfmt+0xe4>
            for (precision = 0; ; ++ fmt) {
c010582a:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
c010582d:	eb d4                	jmp    c0105803 <vprintfmt+0x8a>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
c010582f:	8b 45 14             	mov    0x14(%ebp),%eax
c0105832:	8d 50 04             	lea    0x4(%eax),%edx
c0105835:	89 55 14             	mov    %edx,0x14(%ebp)
c0105838:	8b 00                	mov    (%eax),%eax
c010583a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
c010583d:	eb 1f                	jmp    c010585e <vprintfmt+0xe5>

        case '.':
            if (width < 0)
c010583f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105843:	79 87                	jns    c01057cc <vprintfmt+0x53>
                width = 0;
c0105845:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
c010584c:	e9 7b ff ff ff       	jmp    c01057cc <vprintfmt+0x53>

        case '#':
            altflag = 1;
c0105851:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
c0105858:	e9 6f ff ff ff       	jmp    c01057cc <vprintfmt+0x53>
            goto process_precision;
c010585d:	90                   	nop

        process_precision:
            if (width < 0)
c010585e:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105862:	0f 89 64 ff ff ff    	jns    c01057cc <vprintfmt+0x53>
                width = precision, precision = -1;
c0105868:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010586b:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010586e:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
c0105875:	e9 52 ff ff ff       	jmp    c01057cc <vprintfmt+0x53>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
c010587a:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
c010587d:	e9 4a ff ff ff       	jmp    c01057cc <vprintfmt+0x53>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
c0105882:	8b 45 14             	mov    0x14(%ebp),%eax
c0105885:	8d 50 04             	lea    0x4(%eax),%edx
c0105888:	89 55 14             	mov    %edx,0x14(%ebp)
c010588b:	8b 00                	mov    (%eax),%eax
c010588d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0105890:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105894:	89 04 24             	mov    %eax,(%esp)
c0105897:	8b 45 08             	mov    0x8(%ebp),%eax
c010589a:	ff d0                	call   *%eax
            break;
c010589c:	e9 a4 02 00 00       	jmp    c0105b45 <vprintfmt+0x3cc>

        // error message
        case 'e':
            err = va_arg(ap, int);
c01058a1:	8b 45 14             	mov    0x14(%ebp),%eax
c01058a4:	8d 50 04             	lea    0x4(%eax),%edx
c01058a7:	89 55 14             	mov    %edx,0x14(%ebp)
c01058aa:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
c01058ac:	85 db                	test   %ebx,%ebx
c01058ae:	79 02                	jns    c01058b2 <vprintfmt+0x139>
                err = -err;
c01058b0:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c01058b2:	83 fb 06             	cmp    $0x6,%ebx
c01058b5:	7f 0b                	jg     c01058c2 <vprintfmt+0x149>
c01058b7:	8b 34 9d 48 72 10 c0 	mov    -0x3fef8db8(,%ebx,4),%esi
c01058be:	85 f6                	test   %esi,%esi
c01058c0:	75 23                	jne    c01058e5 <vprintfmt+0x16c>
                printfmt(putch, putdat, "error %d", err);
c01058c2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c01058c6:	c7 44 24 08 75 72 10 	movl   $0xc0107275,0x8(%esp)
c01058cd:	c0 
c01058ce:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058d1:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058d5:	8b 45 08             	mov    0x8(%ebp),%eax
c01058d8:	89 04 24             	mov    %eax,(%esp)
c01058db:	e8 68 fe ff ff       	call   c0105748 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
c01058e0:	e9 60 02 00 00       	jmp    c0105b45 <vprintfmt+0x3cc>
                printfmt(putch, putdat, "%s", p);
c01058e5:	89 74 24 0c          	mov    %esi,0xc(%esp)
c01058e9:	c7 44 24 08 7e 72 10 	movl   $0xc010727e,0x8(%esp)
c01058f0:	c0 
c01058f1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058f4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01058f8:	8b 45 08             	mov    0x8(%ebp),%eax
c01058fb:	89 04 24             	mov    %eax,(%esp)
c01058fe:	e8 45 fe ff ff       	call   c0105748 <printfmt>
            break;
c0105903:	e9 3d 02 00 00       	jmp    c0105b45 <vprintfmt+0x3cc>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
c0105908:	8b 45 14             	mov    0x14(%ebp),%eax
c010590b:	8d 50 04             	lea    0x4(%eax),%edx
c010590e:	89 55 14             	mov    %edx,0x14(%ebp)
c0105911:	8b 30                	mov    (%eax),%esi
c0105913:	85 f6                	test   %esi,%esi
c0105915:	75 05                	jne    c010591c <vprintfmt+0x1a3>
                p = "(null)";
c0105917:	be 81 72 10 c0       	mov    $0xc0107281,%esi
            }
            if (width > 0 && padc != '-') {
c010591c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0105920:	7e 76                	jle    c0105998 <vprintfmt+0x21f>
c0105922:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
c0105926:	74 70                	je     c0105998 <vprintfmt+0x21f>
                for (width -= strnlen(p, precision); width > 0; width --) {
c0105928:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010592b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010592f:	89 34 24             	mov    %esi,(%esp)
c0105932:	e8 16 03 00 00       	call   c0105c4d <strnlen>
c0105937:	89 c2                	mov    %eax,%edx
c0105939:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010593c:	29 d0                	sub    %edx,%eax
c010593e:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105941:	eb 16                	jmp    c0105959 <vprintfmt+0x1e0>
                    putch(padc, putdat);
c0105943:	0f be 45 db          	movsbl -0x25(%ebp),%eax
c0105947:	8b 55 0c             	mov    0xc(%ebp),%edx
c010594a:	89 54 24 04          	mov    %edx,0x4(%esp)
c010594e:	89 04 24             	mov    %eax,(%esp)
c0105951:	8b 45 08             	mov    0x8(%ebp),%eax
c0105954:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
c0105956:	ff 4d e8             	decl   -0x18(%ebp)
c0105959:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c010595d:	7f e4                	jg     c0105943 <vprintfmt+0x1ca>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c010595f:	eb 37                	jmp    c0105998 <vprintfmt+0x21f>
                if (altflag && (ch < ' ' || ch > '~')) {
c0105961:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0105965:	74 1f                	je     c0105986 <vprintfmt+0x20d>
c0105967:	83 fb 1f             	cmp    $0x1f,%ebx
c010596a:	7e 05                	jle    c0105971 <vprintfmt+0x1f8>
c010596c:	83 fb 7e             	cmp    $0x7e,%ebx
c010596f:	7e 15                	jle    c0105986 <vprintfmt+0x20d>
                    putch('?', putdat);
c0105971:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105974:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105978:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
c010597f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105982:	ff d0                	call   *%eax
c0105984:	eb 0f                	jmp    c0105995 <vprintfmt+0x21c>
                }
                else {
                    putch(ch, putdat);
c0105986:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105989:	89 44 24 04          	mov    %eax,0x4(%esp)
c010598d:	89 1c 24             	mov    %ebx,(%esp)
c0105990:	8b 45 08             	mov    0x8(%ebp),%eax
c0105993:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c0105995:	ff 4d e8             	decl   -0x18(%ebp)
c0105998:	89 f0                	mov    %esi,%eax
c010599a:	8d 70 01             	lea    0x1(%eax),%esi
c010599d:	0f b6 00             	movzbl (%eax),%eax
c01059a0:	0f be d8             	movsbl %al,%ebx
c01059a3:	85 db                	test   %ebx,%ebx
c01059a5:	74 27                	je     c01059ce <vprintfmt+0x255>
c01059a7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01059ab:	78 b4                	js     c0105961 <vprintfmt+0x1e8>
c01059ad:	ff 4d e4             	decl   -0x1c(%ebp)
c01059b0:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01059b4:	79 ab                	jns    c0105961 <vprintfmt+0x1e8>
                }
            }
            for (; width > 0; width --) {
c01059b6:	eb 16                	jmp    c01059ce <vprintfmt+0x255>
                putch(' ', putdat);
c01059b8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059bb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059bf:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c01059c6:	8b 45 08             	mov    0x8(%ebp),%eax
c01059c9:	ff d0                	call   *%eax
            for (; width > 0; width --) {
c01059cb:	ff 4d e8             	decl   -0x18(%ebp)
c01059ce:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01059d2:	7f e4                	jg     c01059b8 <vprintfmt+0x23f>
            }
            break;
c01059d4:	e9 6c 01 00 00       	jmp    c0105b45 <vprintfmt+0x3cc>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
c01059d9:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01059dc:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059e0:	8d 45 14             	lea    0x14(%ebp),%eax
c01059e3:	89 04 24             	mov    %eax,(%esp)
c01059e6:	e8 16 fd ff ff       	call   c0105701 <getint>
c01059eb:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01059ee:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
c01059f1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01059f4:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01059f7:	85 d2                	test   %edx,%edx
c01059f9:	79 26                	jns    c0105a21 <vprintfmt+0x2a8>
                putch('-', putdat);
c01059fb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01059fe:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a02:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
c0105a09:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a0c:	ff d0                	call   *%eax
                num = -(long long)num;
c0105a0e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a11:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105a14:	f7 d8                	neg    %eax
c0105a16:	83 d2 00             	adc    $0x0,%edx
c0105a19:	f7 da                	neg    %edx
c0105a1b:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a1e:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
c0105a21:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c0105a28:	e9 a8 00 00 00       	jmp    c0105ad5 <vprintfmt+0x35c>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
c0105a2d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a30:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a34:	8d 45 14             	lea    0x14(%ebp),%eax
c0105a37:	89 04 24             	mov    %eax,(%esp)
c0105a3a:	e8 73 fc ff ff       	call   c01056b2 <getuint>
c0105a3f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a42:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
c0105a45:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c0105a4c:	e9 84 00 00 00       	jmp    c0105ad5 <vprintfmt+0x35c>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
c0105a51:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a54:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a58:	8d 45 14             	lea    0x14(%ebp),%eax
c0105a5b:	89 04 24             	mov    %eax,(%esp)
c0105a5e:	e8 4f fc ff ff       	call   c01056b2 <getuint>
c0105a63:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a66:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
c0105a69:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
c0105a70:	eb 63                	jmp    c0105ad5 <vprintfmt+0x35c>

        // pointer
        case 'p':
            putch('0', putdat);
c0105a72:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a75:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a79:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
c0105a80:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a83:	ff d0                	call   *%eax
            putch('x', putdat);
c0105a85:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105a88:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105a8c:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
c0105a93:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a96:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c0105a98:	8b 45 14             	mov    0x14(%ebp),%eax
c0105a9b:	8d 50 04             	lea    0x4(%eax),%edx
c0105a9e:	89 55 14             	mov    %edx,0x14(%ebp)
c0105aa1:	8b 00                	mov    (%eax),%eax
c0105aa3:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105aa6:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
c0105aad:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
c0105ab4:	eb 1f                	jmp    c0105ad5 <vprintfmt+0x35c>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
c0105ab6:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105ab9:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105abd:	8d 45 14             	lea    0x14(%ebp),%eax
c0105ac0:	89 04 24             	mov    %eax,(%esp)
c0105ac3:	e8 ea fb ff ff       	call   c01056b2 <getuint>
c0105ac8:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105acb:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
c0105ace:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
c0105ad5:	0f be 55 db          	movsbl -0x25(%ebp),%edx
c0105ad9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105adc:	89 54 24 18          	mov    %edx,0x18(%esp)
c0105ae0:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105ae3:	89 54 24 14          	mov    %edx,0x14(%esp)
c0105ae7:	89 44 24 10          	mov    %eax,0x10(%esp)
c0105aeb:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105aee:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105af1:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105af5:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0105af9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105afc:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b00:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b03:	89 04 24             	mov    %eax,(%esp)
c0105b06:	e8 a5 fa ff ff       	call   c01055b0 <printnum>
            break;
c0105b0b:	eb 38                	jmp    c0105b45 <vprintfmt+0x3cc>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
c0105b0d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b10:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b14:	89 1c 24             	mov    %ebx,(%esp)
c0105b17:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b1a:	ff d0                	call   *%eax
            break;
c0105b1c:	eb 27                	jmp    c0105b45 <vprintfmt+0x3cc>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
c0105b1e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b21:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b25:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
c0105b2c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b2f:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
c0105b31:	ff 4d 10             	decl   0x10(%ebp)
c0105b34:	eb 03                	jmp    c0105b39 <vprintfmt+0x3c0>
c0105b36:	ff 4d 10             	decl   0x10(%ebp)
c0105b39:	8b 45 10             	mov    0x10(%ebp),%eax
c0105b3c:	48                   	dec    %eax
c0105b3d:	0f b6 00             	movzbl (%eax),%eax
c0105b40:	3c 25                	cmp    $0x25,%al
c0105b42:	75 f2                	jne    c0105b36 <vprintfmt+0x3bd>
                /* do nothing */;
            break;
c0105b44:	90                   	nop
    while (1) {
c0105b45:	e9 37 fc ff ff       	jmp    c0105781 <vprintfmt+0x8>
                return;
c0105b4a:	90                   	nop
        }
    }
}
c0105b4b:	83 c4 40             	add    $0x40,%esp
c0105b4e:	5b                   	pop    %ebx
c0105b4f:	5e                   	pop    %esi
c0105b50:	5d                   	pop    %ebp
c0105b51:	c3                   	ret    

c0105b52 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c0105b52:	55                   	push   %ebp
c0105b53:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
c0105b55:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b58:	8b 40 08             	mov    0x8(%eax),%eax
c0105b5b:	8d 50 01             	lea    0x1(%eax),%edx
c0105b5e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b61:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
c0105b64:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b67:	8b 10                	mov    (%eax),%edx
c0105b69:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b6c:	8b 40 04             	mov    0x4(%eax),%eax
c0105b6f:	39 c2                	cmp    %eax,%edx
c0105b71:	73 12                	jae    c0105b85 <sprintputch+0x33>
        *b->buf ++ = ch;
c0105b73:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105b76:	8b 00                	mov    (%eax),%eax
c0105b78:	8d 48 01             	lea    0x1(%eax),%ecx
c0105b7b:	8b 55 0c             	mov    0xc(%ebp),%edx
c0105b7e:	89 0a                	mov    %ecx,(%edx)
c0105b80:	8b 55 08             	mov    0x8(%ebp),%edx
c0105b83:	88 10                	mov    %dl,(%eax)
    }
}
c0105b85:	90                   	nop
c0105b86:	5d                   	pop    %ebp
c0105b87:	c3                   	ret    

c0105b88 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c0105b88:	55                   	push   %ebp
c0105b89:	89 e5                	mov    %esp,%ebp
c0105b8b:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c0105b8e:	8d 45 14             	lea    0x14(%ebp),%eax
c0105b91:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
c0105b94:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105b97:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105b9b:	8b 45 10             	mov    0x10(%ebp),%eax
c0105b9e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105ba2:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105ba5:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105ba9:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bac:	89 04 24             	mov    %eax,(%esp)
c0105baf:	e8 0a 00 00 00       	call   c0105bbe <vsnprintf>
c0105bb4:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0105bb7:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105bba:	89 ec                	mov    %ebp,%esp
c0105bbc:	5d                   	pop    %ebp
c0105bbd:	c3                   	ret    

c0105bbe <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c0105bbe:	55                   	push   %ebp
c0105bbf:	89 e5                	mov    %esp,%ebp
c0105bc1:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
c0105bc4:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bc7:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105bca:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105bcd:	8d 50 ff             	lea    -0x1(%eax),%edx
c0105bd0:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bd3:	01 d0                	add    %edx,%eax
c0105bd5:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105bd8:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
c0105bdf:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0105be3:	74 0a                	je     c0105bef <vsnprintf+0x31>
c0105be5:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105be8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105beb:	39 c2                	cmp    %eax,%edx
c0105bed:	76 07                	jbe    c0105bf6 <vsnprintf+0x38>
        return -E_INVAL;
c0105bef:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c0105bf4:	eb 2a                	jmp    c0105c20 <vsnprintf+0x62>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
c0105bf6:	8b 45 14             	mov    0x14(%ebp),%eax
c0105bf9:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105bfd:	8b 45 10             	mov    0x10(%ebp),%eax
c0105c00:	89 44 24 08          	mov    %eax,0x8(%esp)
c0105c04:	8d 45 ec             	lea    -0x14(%ebp),%eax
c0105c07:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105c0b:	c7 04 24 52 5b 10 c0 	movl   $0xc0105b52,(%esp)
c0105c12:	e8 62 fb ff ff       	call   c0105779 <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
c0105c17:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105c1a:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
c0105c1d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105c20:	89 ec                	mov    %ebp,%esp
c0105c22:	5d                   	pop    %ebp
c0105c23:	c3                   	ret    

c0105c24 <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c0105c24:	55                   	push   %ebp
c0105c25:	89 e5                	mov    %esp,%ebp
c0105c27:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105c2a:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
c0105c31:	eb 03                	jmp    c0105c36 <strlen+0x12>
        cnt ++;
c0105c33:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
c0105c36:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c39:	8d 50 01             	lea    0x1(%eax),%edx
c0105c3c:	89 55 08             	mov    %edx,0x8(%ebp)
c0105c3f:	0f b6 00             	movzbl (%eax),%eax
c0105c42:	84 c0                	test   %al,%al
c0105c44:	75 ed                	jne    c0105c33 <strlen+0xf>
    }
    return cnt;
c0105c46:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105c49:	89 ec                	mov    %ebp,%esp
c0105c4b:	5d                   	pop    %ebp
c0105c4c:	c3                   	ret    

c0105c4d <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c0105c4d:	55                   	push   %ebp
c0105c4e:	89 e5                	mov    %esp,%ebp
c0105c50:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c0105c53:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c0105c5a:	eb 03                	jmp    c0105c5f <strnlen+0x12>
        cnt ++;
c0105c5c:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c0105c5f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105c62:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105c65:	73 10                	jae    c0105c77 <strnlen+0x2a>
c0105c67:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c6a:	8d 50 01             	lea    0x1(%eax),%edx
c0105c6d:	89 55 08             	mov    %edx,0x8(%ebp)
c0105c70:	0f b6 00             	movzbl (%eax),%eax
c0105c73:	84 c0                	test   %al,%al
c0105c75:	75 e5                	jne    c0105c5c <strnlen+0xf>
    }
    return cnt;
c0105c77:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0105c7a:	89 ec                	mov    %ebp,%esp
c0105c7c:	5d                   	pop    %ebp
c0105c7d:	c3                   	ret    

c0105c7e <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c0105c7e:	55                   	push   %ebp
c0105c7f:	89 e5                	mov    %esp,%ebp
c0105c81:	57                   	push   %edi
c0105c82:	56                   	push   %esi
c0105c83:	83 ec 20             	sub    $0x20,%esp
c0105c86:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c89:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105c8c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105c8f:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
c0105c92:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0105c95:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105c98:	89 d1                	mov    %edx,%ecx
c0105c9a:	89 c2                	mov    %eax,%edx
c0105c9c:	89 ce                	mov    %ecx,%esi
c0105c9e:	89 d7                	mov    %edx,%edi
c0105ca0:	ac                   	lods   %ds:(%esi),%al
c0105ca1:	aa                   	stos   %al,%es:(%edi)
c0105ca2:	84 c0                	test   %al,%al
c0105ca4:	75 fa                	jne    c0105ca0 <strcpy+0x22>
c0105ca6:	89 fa                	mov    %edi,%edx
c0105ca8:	89 f1                	mov    %esi,%ecx
c0105caa:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0105cad:	89 55 e8             	mov    %edx,-0x18(%ebp)
c0105cb0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
c0105cb3:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c0105cb6:	83 c4 20             	add    $0x20,%esp
c0105cb9:	5e                   	pop    %esi
c0105cba:	5f                   	pop    %edi
c0105cbb:	5d                   	pop    %ebp
c0105cbc:	c3                   	ret    

c0105cbd <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0105cbd:	55                   	push   %ebp
c0105cbe:	89 e5                	mov    %esp,%ebp
c0105cc0:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
c0105cc3:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cc6:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
c0105cc9:	eb 1e                	jmp    c0105ce9 <strncpy+0x2c>
        if ((*p = *src) != '\0') {
c0105ccb:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105cce:	0f b6 10             	movzbl (%eax),%edx
c0105cd1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105cd4:	88 10                	mov    %dl,(%eax)
c0105cd6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105cd9:	0f b6 00             	movzbl (%eax),%eax
c0105cdc:	84 c0                	test   %al,%al
c0105cde:	74 03                	je     c0105ce3 <strncpy+0x26>
            src ++;
c0105ce0:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
c0105ce3:	ff 45 fc             	incl   -0x4(%ebp)
c0105ce6:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
c0105ce9:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105ced:	75 dc                	jne    c0105ccb <strncpy+0xe>
    }
    return dst;
c0105cef:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105cf2:	89 ec                	mov    %ebp,%esp
c0105cf4:	5d                   	pop    %ebp
c0105cf5:	c3                   	ret    

c0105cf6 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c0105cf6:	55                   	push   %ebp
c0105cf7:	89 e5                	mov    %esp,%ebp
c0105cf9:	57                   	push   %edi
c0105cfa:	56                   	push   %esi
c0105cfb:	83 ec 20             	sub    $0x20,%esp
c0105cfe:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d01:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105d04:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d07:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
c0105d0a:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0105d0d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105d10:	89 d1                	mov    %edx,%ecx
c0105d12:	89 c2                	mov    %eax,%edx
c0105d14:	89 ce                	mov    %ecx,%esi
c0105d16:	89 d7                	mov    %edx,%edi
c0105d18:	ac                   	lods   %ds:(%esi),%al
c0105d19:	ae                   	scas   %es:(%edi),%al
c0105d1a:	75 08                	jne    c0105d24 <strcmp+0x2e>
c0105d1c:	84 c0                	test   %al,%al
c0105d1e:	75 f8                	jne    c0105d18 <strcmp+0x22>
c0105d20:	31 c0                	xor    %eax,%eax
c0105d22:	eb 04                	jmp    c0105d28 <strcmp+0x32>
c0105d24:	19 c0                	sbb    %eax,%eax
c0105d26:	0c 01                	or     $0x1,%al
c0105d28:	89 fa                	mov    %edi,%edx
c0105d2a:	89 f1                	mov    %esi,%ecx
c0105d2c:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105d2f:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0105d32:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
c0105d35:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c0105d38:	83 c4 20             	add    $0x20,%esp
c0105d3b:	5e                   	pop    %esi
c0105d3c:	5f                   	pop    %edi
c0105d3d:	5d                   	pop    %ebp
c0105d3e:	c3                   	ret    

c0105d3f <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c0105d3f:	55                   	push   %ebp
c0105d40:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105d42:	eb 09                	jmp    c0105d4d <strncmp+0xe>
        n --, s1 ++, s2 ++;
c0105d44:	ff 4d 10             	decl   0x10(%ebp)
c0105d47:	ff 45 08             	incl   0x8(%ebp)
c0105d4a:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0105d4d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105d51:	74 1a                	je     c0105d6d <strncmp+0x2e>
c0105d53:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d56:	0f b6 00             	movzbl (%eax),%eax
c0105d59:	84 c0                	test   %al,%al
c0105d5b:	74 10                	je     c0105d6d <strncmp+0x2e>
c0105d5d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d60:	0f b6 10             	movzbl (%eax),%edx
c0105d63:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d66:	0f b6 00             	movzbl (%eax),%eax
c0105d69:	38 c2                	cmp    %al,%dl
c0105d6b:	74 d7                	je     c0105d44 <strncmp+0x5>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c0105d6d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105d71:	74 18                	je     c0105d8b <strncmp+0x4c>
c0105d73:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d76:	0f b6 00             	movzbl (%eax),%eax
c0105d79:	0f b6 d0             	movzbl %al,%edx
c0105d7c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d7f:	0f b6 00             	movzbl (%eax),%eax
c0105d82:	0f b6 c8             	movzbl %al,%ecx
c0105d85:	89 d0                	mov    %edx,%eax
c0105d87:	29 c8                	sub    %ecx,%eax
c0105d89:	eb 05                	jmp    c0105d90 <strncmp+0x51>
c0105d8b:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105d90:	5d                   	pop    %ebp
c0105d91:	c3                   	ret    

c0105d92 <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0105d92:	55                   	push   %ebp
c0105d93:	89 e5                	mov    %esp,%ebp
c0105d95:	83 ec 04             	sub    $0x4,%esp
c0105d98:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d9b:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105d9e:	eb 13                	jmp    c0105db3 <strchr+0x21>
        if (*s == c) {
c0105da0:	8b 45 08             	mov    0x8(%ebp),%eax
c0105da3:	0f b6 00             	movzbl (%eax),%eax
c0105da6:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0105da9:	75 05                	jne    c0105db0 <strchr+0x1e>
            return (char *)s;
c0105dab:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dae:	eb 12                	jmp    c0105dc2 <strchr+0x30>
        }
        s ++;
c0105db0:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0105db3:	8b 45 08             	mov    0x8(%ebp),%eax
c0105db6:	0f b6 00             	movzbl (%eax),%eax
c0105db9:	84 c0                	test   %al,%al
c0105dbb:	75 e3                	jne    c0105da0 <strchr+0xe>
    }
    return NULL;
c0105dbd:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0105dc2:	89 ec                	mov    %ebp,%esp
c0105dc4:	5d                   	pop    %ebp
c0105dc5:	c3                   	ret    

c0105dc6 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0105dc6:	55                   	push   %ebp
c0105dc7:	89 e5                	mov    %esp,%ebp
c0105dc9:	83 ec 04             	sub    $0x4,%esp
c0105dcc:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105dcf:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0105dd2:	eb 0e                	jmp    c0105de2 <strfind+0x1c>
        if (*s == c) {
c0105dd4:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dd7:	0f b6 00             	movzbl (%eax),%eax
c0105dda:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0105ddd:	74 0f                	je     c0105dee <strfind+0x28>
            break;
        }
        s ++;
c0105ddf:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0105de2:	8b 45 08             	mov    0x8(%ebp),%eax
c0105de5:	0f b6 00             	movzbl (%eax),%eax
c0105de8:	84 c0                	test   %al,%al
c0105dea:	75 e8                	jne    c0105dd4 <strfind+0xe>
c0105dec:	eb 01                	jmp    c0105def <strfind+0x29>
            break;
c0105dee:	90                   	nop
    }
    return (char *)s;
c0105def:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0105df2:	89 ec                	mov    %ebp,%esp
c0105df4:	5d                   	pop    %ebp
c0105df5:	c3                   	ret    

c0105df6 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0105df6:	55                   	push   %ebp
c0105df7:	89 e5                	mov    %esp,%ebp
c0105df9:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
c0105dfc:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
c0105e03:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0105e0a:	eb 03                	jmp    c0105e0f <strtol+0x19>
        s ++;
c0105e0c:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
c0105e0f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e12:	0f b6 00             	movzbl (%eax),%eax
c0105e15:	3c 20                	cmp    $0x20,%al
c0105e17:	74 f3                	je     c0105e0c <strtol+0x16>
c0105e19:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e1c:	0f b6 00             	movzbl (%eax),%eax
c0105e1f:	3c 09                	cmp    $0x9,%al
c0105e21:	74 e9                	je     c0105e0c <strtol+0x16>
    }

    // plus/minus sign
    if (*s == '+') {
c0105e23:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e26:	0f b6 00             	movzbl (%eax),%eax
c0105e29:	3c 2b                	cmp    $0x2b,%al
c0105e2b:	75 05                	jne    c0105e32 <strtol+0x3c>
        s ++;
c0105e2d:	ff 45 08             	incl   0x8(%ebp)
c0105e30:	eb 14                	jmp    c0105e46 <strtol+0x50>
    }
    else if (*s == '-') {
c0105e32:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e35:	0f b6 00             	movzbl (%eax),%eax
c0105e38:	3c 2d                	cmp    $0x2d,%al
c0105e3a:	75 0a                	jne    c0105e46 <strtol+0x50>
        s ++, neg = 1;
c0105e3c:	ff 45 08             	incl   0x8(%ebp)
c0105e3f:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0105e46:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105e4a:	74 06                	je     c0105e52 <strtol+0x5c>
c0105e4c:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0105e50:	75 22                	jne    c0105e74 <strtol+0x7e>
c0105e52:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e55:	0f b6 00             	movzbl (%eax),%eax
c0105e58:	3c 30                	cmp    $0x30,%al
c0105e5a:	75 18                	jne    c0105e74 <strtol+0x7e>
c0105e5c:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e5f:	40                   	inc    %eax
c0105e60:	0f b6 00             	movzbl (%eax),%eax
c0105e63:	3c 78                	cmp    $0x78,%al
c0105e65:	75 0d                	jne    c0105e74 <strtol+0x7e>
        s += 2, base = 16;
c0105e67:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0105e6b:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
c0105e72:	eb 29                	jmp    c0105e9d <strtol+0xa7>
    }
    else if (base == 0 && s[0] == '0') {
c0105e74:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105e78:	75 16                	jne    c0105e90 <strtol+0x9a>
c0105e7a:	8b 45 08             	mov    0x8(%ebp),%eax
c0105e7d:	0f b6 00             	movzbl (%eax),%eax
c0105e80:	3c 30                	cmp    $0x30,%al
c0105e82:	75 0c                	jne    c0105e90 <strtol+0x9a>
        s ++, base = 8;
c0105e84:	ff 45 08             	incl   0x8(%ebp)
c0105e87:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
c0105e8e:	eb 0d                	jmp    c0105e9d <strtol+0xa7>
    }
    else if (base == 0) {
c0105e90:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0105e94:	75 07                	jne    c0105e9d <strtol+0xa7>
        base = 10;
c0105e96:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0105e9d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ea0:	0f b6 00             	movzbl (%eax),%eax
c0105ea3:	3c 2f                	cmp    $0x2f,%al
c0105ea5:	7e 1b                	jle    c0105ec2 <strtol+0xcc>
c0105ea7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105eaa:	0f b6 00             	movzbl (%eax),%eax
c0105ead:	3c 39                	cmp    $0x39,%al
c0105eaf:	7f 11                	jg     c0105ec2 <strtol+0xcc>
            dig = *s - '0';
c0105eb1:	8b 45 08             	mov    0x8(%ebp),%eax
c0105eb4:	0f b6 00             	movzbl (%eax),%eax
c0105eb7:	0f be c0             	movsbl %al,%eax
c0105eba:	83 e8 30             	sub    $0x30,%eax
c0105ebd:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105ec0:	eb 48                	jmp    c0105f0a <strtol+0x114>
        }
        else if (*s >= 'a' && *s <= 'z') {
c0105ec2:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ec5:	0f b6 00             	movzbl (%eax),%eax
c0105ec8:	3c 60                	cmp    $0x60,%al
c0105eca:	7e 1b                	jle    c0105ee7 <strtol+0xf1>
c0105ecc:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ecf:	0f b6 00             	movzbl (%eax),%eax
c0105ed2:	3c 7a                	cmp    $0x7a,%al
c0105ed4:	7f 11                	jg     c0105ee7 <strtol+0xf1>
            dig = *s - 'a' + 10;
c0105ed6:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ed9:	0f b6 00             	movzbl (%eax),%eax
c0105edc:	0f be c0             	movsbl %al,%eax
c0105edf:	83 e8 57             	sub    $0x57,%eax
c0105ee2:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105ee5:	eb 23                	jmp    c0105f0a <strtol+0x114>
        }
        else if (*s >= 'A' && *s <= 'Z') {
c0105ee7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105eea:	0f b6 00             	movzbl (%eax),%eax
c0105eed:	3c 40                	cmp    $0x40,%al
c0105eef:	7e 3b                	jle    c0105f2c <strtol+0x136>
c0105ef1:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ef4:	0f b6 00             	movzbl (%eax),%eax
c0105ef7:	3c 5a                	cmp    $0x5a,%al
c0105ef9:	7f 31                	jg     c0105f2c <strtol+0x136>
            dig = *s - 'A' + 10;
c0105efb:	8b 45 08             	mov    0x8(%ebp),%eax
c0105efe:	0f b6 00             	movzbl (%eax),%eax
c0105f01:	0f be c0             	movsbl %al,%eax
c0105f04:	83 e8 37             	sub    $0x37,%eax
c0105f07:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
c0105f0a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105f0d:	3b 45 10             	cmp    0x10(%ebp),%eax
c0105f10:	7d 19                	jge    c0105f2b <strtol+0x135>
            break;
        }
        s ++, val = (val * base) + dig;
c0105f12:	ff 45 08             	incl   0x8(%ebp)
c0105f15:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105f18:	0f af 45 10          	imul   0x10(%ebp),%eax
c0105f1c:	89 c2                	mov    %eax,%edx
c0105f1e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105f21:	01 d0                	add    %edx,%eax
c0105f23:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
c0105f26:	e9 72 ff ff ff       	jmp    c0105e9d <strtol+0xa7>
            break;
c0105f2b:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
c0105f2c:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0105f30:	74 08                	je     c0105f3a <strtol+0x144>
        *endptr = (char *) s;
c0105f32:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105f35:	8b 55 08             	mov    0x8(%ebp),%edx
c0105f38:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
c0105f3a:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0105f3e:	74 07                	je     c0105f47 <strtol+0x151>
c0105f40:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105f43:	f7 d8                	neg    %eax
c0105f45:	eb 03                	jmp    c0105f4a <strtol+0x154>
c0105f47:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0105f4a:	89 ec                	mov    %ebp,%esp
c0105f4c:	5d                   	pop    %ebp
c0105f4d:	c3                   	ret    

c0105f4e <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0105f4e:	55                   	push   %ebp
c0105f4f:	89 e5                	mov    %esp,%ebp
c0105f51:	83 ec 28             	sub    $0x28,%esp
c0105f54:	89 7d fc             	mov    %edi,-0x4(%ebp)
c0105f57:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105f5a:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
c0105f5d:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
c0105f61:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f64:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0105f67:	88 55 f7             	mov    %dl,-0x9(%ebp)
c0105f6a:	8b 45 10             	mov    0x10(%ebp),%eax
c0105f6d:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
c0105f70:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0105f73:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
c0105f77:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0105f7a:	89 d7                	mov    %edx,%edi
c0105f7c:	f3 aa                	rep stos %al,%es:(%edi)
c0105f7e:	89 fa                	mov    %edi,%edx
c0105f80:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0105f83:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
c0105f86:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0105f89:	8b 7d fc             	mov    -0x4(%ebp),%edi
c0105f8c:	89 ec                	mov    %ebp,%esp
c0105f8e:	5d                   	pop    %ebp
c0105f8f:	c3                   	ret    

c0105f90 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0105f90:	55                   	push   %ebp
c0105f91:	89 e5                	mov    %esp,%ebp
c0105f93:	57                   	push   %edi
c0105f94:	56                   	push   %esi
c0105f95:	53                   	push   %ebx
c0105f96:	83 ec 30             	sub    $0x30,%esp
c0105f99:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f9c:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105f9f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105fa2:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105fa5:	8b 45 10             	mov    0x10(%ebp),%eax
c0105fa8:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
c0105fab:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105fae:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0105fb1:	73 42                	jae    c0105ff5 <memmove+0x65>
c0105fb3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105fb6:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105fb9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105fbc:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0105fbf:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105fc2:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0105fc5:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105fc8:	c1 e8 02             	shr    $0x2,%eax
c0105fcb:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0105fcd:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105fd0:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105fd3:	89 d7                	mov    %edx,%edi
c0105fd5:	89 c6                	mov    %eax,%esi
c0105fd7:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0105fd9:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0105fdc:	83 e1 03             	and    $0x3,%ecx
c0105fdf:	74 02                	je     c0105fe3 <memmove+0x53>
c0105fe1:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0105fe3:	89 f0                	mov    %esi,%eax
c0105fe5:	89 fa                	mov    %edi,%edx
c0105fe7:	89 4d d8             	mov    %ecx,-0x28(%ebp)
c0105fea:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0105fed:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
c0105ff0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
c0105ff3:	eb 36                	jmp    c010602b <memmove+0x9b>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0105ff5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ff8:	8d 50 ff             	lea    -0x1(%eax),%edx
c0105ffb:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105ffe:	01 c2                	add    %eax,%edx
c0106000:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106003:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0106006:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106009:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
c010600c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010600f:	89 c1                	mov    %eax,%ecx
c0106011:	89 d8                	mov    %ebx,%eax
c0106013:	89 d6                	mov    %edx,%esi
c0106015:	89 c7                	mov    %eax,%edi
c0106017:	fd                   	std    
c0106018:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c010601a:	fc                   	cld    
c010601b:	89 f8                	mov    %edi,%eax
c010601d:	89 f2                	mov    %esi,%edx
c010601f:	89 4d cc             	mov    %ecx,-0x34(%ebp)
c0106022:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0106025:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
c0106028:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c010602b:	83 c4 30             	add    $0x30,%esp
c010602e:	5b                   	pop    %ebx
c010602f:	5e                   	pop    %esi
c0106030:	5f                   	pop    %edi
c0106031:	5d                   	pop    %ebp
c0106032:	c3                   	ret    

c0106033 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0106033:	55                   	push   %ebp
c0106034:	89 e5                	mov    %esp,%ebp
c0106036:	57                   	push   %edi
c0106037:	56                   	push   %esi
c0106038:	83 ec 20             	sub    $0x20,%esp
c010603b:	8b 45 08             	mov    0x8(%ebp),%eax
c010603e:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0106041:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106044:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106047:	8b 45 10             	mov    0x10(%ebp),%eax
c010604a:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c010604d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106050:	c1 e8 02             	shr    $0x2,%eax
c0106053:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0106055:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0106058:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010605b:	89 d7                	mov    %edx,%edi
c010605d:	89 c6                	mov    %eax,%esi
c010605f:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0106061:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0106064:	83 e1 03             	and    $0x3,%ecx
c0106067:	74 02                	je     c010606b <memcpy+0x38>
c0106069:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c010606b:	89 f0                	mov    %esi,%eax
c010606d:	89 fa                	mov    %edi,%edx
c010606f:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0106072:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c0106075:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
c0106078:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c010607b:	83 c4 20             	add    $0x20,%esp
c010607e:	5e                   	pop    %esi
c010607f:	5f                   	pop    %edi
c0106080:	5d                   	pop    %ebp
c0106081:	c3                   	ret    

c0106082 <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0106082:	55                   	push   %ebp
c0106083:	89 e5                	mov    %esp,%ebp
c0106085:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
c0106088:	8b 45 08             	mov    0x8(%ebp),%eax
c010608b:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
c010608e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106091:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
c0106094:	eb 2e                	jmp    c01060c4 <memcmp+0x42>
        if (*s1 != *s2) {
c0106096:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0106099:	0f b6 10             	movzbl (%eax),%edx
c010609c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010609f:	0f b6 00             	movzbl (%eax),%eax
c01060a2:	38 c2                	cmp    %al,%dl
c01060a4:	74 18                	je     c01060be <memcmp+0x3c>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
c01060a6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01060a9:	0f b6 00             	movzbl (%eax),%eax
c01060ac:	0f b6 d0             	movzbl %al,%edx
c01060af:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01060b2:	0f b6 00             	movzbl (%eax),%eax
c01060b5:	0f b6 c8             	movzbl %al,%ecx
c01060b8:	89 d0                	mov    %edx,%eax
c01060ba:	29 c8                	sub    %ecx,%eax
c01060bc:	eb 18                	jmp    c01060d6 <memcmp+0x54>
        }
        s1 ++, s2 ++;
c01060be:	ff 45 fc             	incl   -0x4(%ebp)
c01060c1:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
c01060c4:	8b 45 10             	mov    0x10(%ebp),%eax
c01060c7:	8d 50 ff             	lea    -0x1(%eax),%edx
c01060ca:	89 55 10             	mov    %edx,0x10(%ebp)
c01060cd:	85 c0                	test   %eax,%eax
c01060cf:	75 c5                	jne    c0106096 <memcmp+0x14>
    }
    return 0;
c01060d1:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01060d6:	89 ec                	mov    %ebp,%esp
c01060d8:	5d                   	pop    %ebp
c01060d9:	c3                   	ret    
